Documentation ¶
Index ¶
- func MergeFilterCSVFilesToJSON(inPaths []string, outPath string, inComma rune, inStripBom bool, ...) error
- type DocumentsSet
- type DocumentsSetMeta
- type Histogram
- func NewHistogram() *Histogram
- func ParseFileCSV(file string, binNameColIdx, binFrequencyColIdx uint) (*Histogram, error)
- func ParseTable(tbl table.Table, binNameColIdx, binFrequencyColIdx uint) (*Histogram, error)
- func TransformBinNames(hist *Histogram, xfFunc func(input string) string) *Histogram
- func TransformBinNamesByPrefix(hist *Histogram, xfMap map[string]string) *Histogram
- type HistogramSet
- type HistogramSetMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DocumentsSet ¶ added in v1.4.0
type DocumentsSet struct { Meta DocumentsSetMeta `json:"meta"` Documents []map[string]string `json:"records"` }
func NewDocumentsSet ¶ added in v1.4.0
func NewDocumentsSet() DocumentsSet
func ReadMergeFilterCSVFiles ¶ added in v1.4.0
func ReadMergeFilterCSVFiles(inPaths []string, outPath string, inComma rune, inStripBom bool, andFilter map[string]stringsutil.MatchInfo) (DocumentsSet, error)
func (*DocumentsSet) CreateHistogram ¶ added in v1.4.0
func (ds *DocumentsSet) CreateHistogram(key string)
func (*DocumentsSet) Inflate ¶ added in v1.4.0
func (ds *DocumentsSet) Inflate()
type DocumentsSetMeta ¶ added in v1.4.0
type DocumentsSetMeta struct { Count int `json:"count"` Histograms map[string]*Histogram `json:"histograms"` }
func NewDocumentsSetMeta ¶ added in v1.4.0
func NewDocumentsSetMeta() DocumentsSetMeta
type Histogram ¶
type Histogram struct { BinCount int `json:"binCount"` BinsFrequency map[string]int `json:"binsFrequency"` }
func NewHistogram ¶
func NewHistogram() *Histogram
func ParseFileCSV ¶ added in v1.4.0
ParseFileCSV reads a CSV using default settings of `,` separator, header row and BOM to be stripped. If you have other configurations, use `table.ReadFile()` directly and call `HistogramFromTable()`.
func ParseTable ¶ added in v1.4.0
ParseTable parses a `table.Table` to a `Histogram` given a table, binName column index and binFrequency column index. Empty rows are skipped.
func TransformBinNames ¶ added in v1.4.0
TransformBinNames modifies bin names and returns a new histogram.
func TransformBinNamesByPrefix ¶ added in v1.4.0
TransformBinNamesByPrefix modifies bin names and returns a new histogram.
type HistogramSet ¶
type HistogramSet struct { Meta HistogramSetMetadata `json:"meta,omitempty"` HistogramMap map[string]*Histogram `json:"histograms"` }
func NewHistogramSet ¶
func NewHistogramSet() HistogramSet
func (*HistogramSet) Add ¶
func (hs *HistogramSet) Add(name, bin string, count int)
func (*HistogramSet) Inflate ¶
func (hs *HistogramSet) Inflate()
type HistogramSetMetadata ¶
type HistogramSetMetadata struct { Names []string `json:"names,omitempty"` NameCount int `json:"nameCount,omitempty"` UniqueBinCount int `json:"uniqueBinCount,omitempty"` }
func NewHistogramSetMetadata ¶
func NewHistogramSetMetadata() HistogramSetMetadata
Click to show internal directories.
Click to hide internal directories.