<commit_before>package library

import (
	"container/heap"
	"errors"
	"fmt"
	"strconv"
	"time"

	"github.com/nytlabs/gojee"                 // jee
	"github.com/nytlabs/streamtools/st/blocks" // blocks
	"github.com/nytlabs/streamtools/st/util"   // util
)

// specify those channels we're going to use to communicate with streamtools
type Histogram struct {
	blocks.Block
	queryrule chan blocks.MsgChan
	historule chan blocks.MsgChan
	inrule    blocks.MsgChan
	inpoll    blocks.MsgChan
	in        blocks.MsgChan
	out       blocks.MsgChan
	quit      blocks.MsgChan
}

// we need to build a simple factory so that streamtools can make new blocks of this kind
func NewHistogram() blocks.BlockInterface {
	return &Histogram{}
}

func buildHistogram(histogram map[string]*PriorityQueue) interface{} {
	var data interface{}<commit_msg>Update histogram.go<commit_after>package library

import (
	"container/heap"
	"errors"
	"strconv"
	"time"

	"github.com/nytlabs/gojee"                 // jee
	"github.com/nytlabs/streamtools/st/blocks" // blocks
	"github.com/nytlabs/streamtools/st/util"   // util
)

// specify those channels we're going to use to communicate with streamtools
type Histogram struct {
	blocks.Block
	queryrule chan blocks.MsgChan
	historule chan blocks.MsgChan
	inrule    blocks.MsgChan
	inpoll    blocks.MsgChan
	in        blocks.MsgChan
	out       blocks.MsgChan
	quit      blocks.MsgChan
}

// we need to build a simple factory so that streamtools can make new blocks of this kind
func NewHistogram() blocks.BlockInterface {
	return &Histogram{}
}

func buildHistogram(histogram map[string]*PriorityQueue) interface{} {
	var data interface{}
{'fraction_non_alphanumeric': 0.08882175226586103, 'fraction_numerical': 0.0, 'mean_word_length': 3.5122615803814714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7356419', 'n_tokens_mistral': 544, 'n_tokens_neox': 520, 'n_words': 147}