index

package
v0.0.0-...-5e56d49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MODE_PLAIN         = ReadMode(1)
	MODE_JSON          = ReadMode(2)
	MODE_PARALLEL_JSON = ReadMode(4)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectConfig

type CollectConfig struct {
	Filter  *TermFilter
	Part    int
	Mode    ReadMode
	Workers int
}

type JsonTextPart

type JsonTextPart struct {
	Number int
	Text   string
	// при работе с горутинами и каналами надо как-то
	// более корректно действовать с ошибками
	Error error
}

func NewErrorPart

func NewErrorPart(err error) *JsonTextPart

type ReadMode

type ReadMode int

type TermFilter

type TermFilter struct {
	// contains filtered or unexported fields
}

func NewTermFilter

func NewTermFilter(opts TermFilterOptions) *TermFilter

func NewTermFilterArgs deprecated

func NewTermFilterArgs(minlen int, includeFirst bool, includeLast bool, reverseFreq bool) *TermFilter

Deprecated: NewTermFilterArgs

func (*TermFilter) IncludeFirst

func (t *TermFilter) IncludeFirst() bool

func (*TermFilter) IncludeLast

func (t *TermFilter) IncludeLast() bool

func (*TermFilter) MatchesLexeme

func (filter *TermFilter) MatchesLexeme(v *lexemes.Lexeme) bool

func (*TermFilter) MatchesStats

func (filter *TermFilter) MatchesStats(v *TermStat) bool

func (*TermFilter) Minlen

func (t *TermFilter) Minlen() int

func (*TermFilter) ReverseFreq

func (t *TermFilter) ReverseFreq() bool

func (*TermFilter) ToDto

func (t *TermFilter) ToDto() TermFilterDto

type TermFilterDto

type TermFilterDto struct {
	Minlen       int  `json:"minlen"`
	IncludeFirst bool `json:"include_first"`
	IncludeLast  bool `json:"include_last"`
	ReverseFreq  bool `json:"reverse_freq"`
}

type TermFilterOptions

type TermFilterOptions struct {
	MinLen       int
	IncludeFirst bool
	IncludeLast  bool
	ReverseFreq  bool
}

type TermStat

type TermStat struct {
	// contains filtered or unexported fields
}

func NewTermStat

func NewTermStat(value string) *TermStat

func NewTermStatCustom

func NewTermStatCustom(config TermStatConfig) *TermStat

func (*TermStat) Count

func (l *TermStat) Count() int

func (*TermStat) FirstCount

func (l *TermStat) FirstCount() int

func (*TermStat) FirstIndex

func (l *TermStat) FirstIndex() int

func (*TermStat) FirstPart

func (l *TermStat) FirstPart() int

func (*TermStat) GetSortIndex

func (l *TermStat) GetSortIndex() int64

GetSortIndex - формирует синтетический порядковый номер для сквозного упорядочения число само по себе не является обозначение позиции

func (*TermStat) LastCount

func (l *TermStat) LastCount() int

func (*TermStat) Len

func (l *TermStat) Len() int

func (*TermStat) Merge

func (l *TermStat) Merge(other *TermStat) *TermStat

func (*TermStat) Register

func (l *TermStat) Register(lexeme *lexemes.Lexeme, part int, idx int)

func (*TermStat) ToDto

func (t *TermStat) ToDto() TermStatDto

func (*TermStat) Value

func (l *TermStat) Value() string

type TermStatCollection

type TermStatCollection struct {
	// contains filtered or unexported fields
}

func CollectFromReader

func CollectFromReader(reader io.Reader, config CollectConfig) *TermStatCollection

func CollectFromString

func CollectFromString(text string, config CollectConfig) *TermStatCollection

func NewTermStatCollection

func NewTermStatCollection() *TermStatCollection

func NewTermStatCollectionF

func NewTermStatCollectionF(filter *TermFilter) *TermStatCollection

func (*TermStatCollection) Add

func (c *TermStatCollection) Add(lexeme *lexemes.Lexeme, part int, idx int)

func (*TermStatCollection) AddError

func (c *TermStatCollection) AddError(e error)

func (*TermStatCollection) AddErrors

func (c *TermStatCollection) AddErrors(e []error)

func (*TermStatCollection) DocOrderIndex

func (c *TermStatCollection) DocOrderIndex() []*TermStat

func (*TermStatCollection) Errors

func (c *TermStatCollection) Errors() []error

func (*TermStatCollection) Find

func (c *TermStatCollection) Find(size int, filter *TermFilter) []*TermStat

func (*TermStatCollection) FreqOrderIndex

func (c *TermStatCollection) FreqOrderIndex() []*TermStat

func (*TermStatCollection) Get

func (c *TermStatCollection) Get(word string) *TermStat

func (*TermStatCollection) IsIndexReady

func (c *TermStatCollection) IsIndexReady() bool

func (*TermStatCollection) Merge

func (*TermStatCollection) RebuildFrequencyIndex

func (c *TermStatCollection) RebuildFrequencyIndex()

func (*TermStatCollection) Terms

func (c *TermStatCollection) Terms() map[string]*TermStat

type TermStatConfig

type TermStatConfig struct {
	Value      string
	FirstPart  int
	FirstIndex int
	Count      int
	FirstCount int
	LastCount  int
}

type TermStatDto

type TermStatDto struct {
	Value      string `json:"value"`
	FirstPart  int    `json:"first_part"`
	FirstIndex int    `json:"first_index"`
	Len        int    `json:"len"`
	Count      int    `json:"count"`
	FirstCount int    `json:"first_count"`
	LastCount  int    `json:"last_count"`
}

type TermStatQuery

type TermStatQuery struct {
	MinLength    int
	MaxLength    int
	AllowStarts  bool
	AllowEnds    bool
	Size         int
	MostFrequent bool
}

TermStatQuery запрос на термы в коллекции

func NewQuery

func NewQuery() TermStatQuery

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL