tok

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: AGPL-3.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FTSTokenizerName = "fulltext"
)

Variables

This section is empty.

Functions

func EncodeGeoTokens added in v0.8.2

func EncodeGeoTokens(tokens []string)

func EncodeRegexTokens added in v0.8.2

func EncodeRegexTokens(tokens []string)

func FtsTokenizerName added in v0.8.2

func FtsTokenizerName(lang string) string

func GetTextTokens added in v0.8.2

func GetTextTokens(funcArgs []string, lang string) ([]string, error)

func GetTokens added in v0.8.2

func GetTokens(funcArgs []string) ([]string, error)

func RegisterTokenizer added in v0.7.3

func RegisterTokenizer(t Tokenizer)

RegisterTokenizer adds your tokenizer to our list.

Types

type BoolTokenizer added in v0.8.2

type BoolTokenizer struct{}

func (BoolTokenizer) Identifier added in v0.8.2

func (t BoolTokenizer) Identifier() byte

func (BoolTokenizer) IsLossy added in v0.8.2

func (t BoolTokenizer) IsLossy() bool

func (BoolTokenizer) IsSortable added in v0.8.2

func (t BoolTokenizer) IsSortable() bool

func (BoolTokenizer) Name added in v0.8.2

func (t BoolTokenizer) Name() string

func (BoolTokenizer) Tokens added in v0.8.2

func (t BoolTokenizer) Tokens(v types.Val) ([]string, error)

func (BoolTokenizer) Type added in v0.8.2

func (t BoolTokenizer) Type() types.TypeID

type DayTokenizer added in v0.8.2

type DayTokenizer struct{}

func (DayTokenizer) Identifier added in v0.8.2

func (t DayTokenizer) Identifier() byte

func (DayTokenizer) IsLossy added in v0.8.2

func (t DayTokenizer) IsLossy() bool

func (DayTokenizer) IsSortable added in v0.8.2

func (t DayTokenizer) IsSortable() bool

func (DayTokenizer) Name added in v0.8.2

func (t DayTokenizer) Name() string

func (DayTokenizer) Tokens added in v0.8.2

func (t DayTokenizer) Tokens(sv types.Val) ([]string, error)

func (DayTokenizer) Type added in v0.8.2

func (t DayTokenizer) Type() types.TypeID

type ExactTokenizer added in v0.7.3

type ExactTokenizer struct{}

func (ExactTokenizer) Identifier added in v0.8.2

func (t ExactTokenizer) Identifier() byte

func (ExactTokenizer) IsLossy added in v0.8.2

func (t ExactTokenizer) IsLossy() bool

func (ExactTokenizer) IsSortable added in v0.8.2

func (t ExactTokenizer) IsSortable() bool

func (ExactTokenizer) Name added in v0.7.3

func (t ExactTokenizer) Name() string

func (ExactTokenizer) Tokens added in v0.7.3

func (t ExactTokenizer) Tokens(sv types.Val) ([]string, error)

func (ExactTokenizer) Type added in v0.7.3

func (t ExactTokenizer) Type() types.TypeID

type FloatTokenizer added in v0.7.3

type FloatTokenizer struct{}

func (FloatTokenizer) Identifier added in v0.8.2

func (t FloatTokenizer) Identifier() byte

func (FloatTokenizer) IsLossy added in v0.8.2

func (t FloatTokenizer) IsLossy() bool

func (FloatTokenizer) IsSortable added in v0.8.2

func (t FloatTokenizer) IsSortable() bool

func (FloatTokenizer) Name added in v0.7.3

func (t FloatTokenizer) Name() string

func (FloatTokenizer) Tokens added in v0.7.3

func (t FloatTokenizer) Tokens(sv types.Val) ([]string, error)

func (FloatTokenizer) Type added in v0.7.3

func (t FloatTokenizer) Type() types.TypeID

type FullTextTokenizer added in v0.8.2

type FullTextTokenizer struct {
	Lang string
}

Full text tokenizer, with language support

func (FullTextTokenizer) Identifier added in v0.8.2

func (t FullTextTokenizer) Identifier() byte

func (FullTextTokenizer) IsLossy added in v0.8.2

func (t FullTextTokenizer) IsLossy() bool

func (FullTextTokenizer) IsSortable added in v0.8.2

func (t FullTextTokenizer) IsSortable() bool

func (FullTextTokenizer) Name added in v0.8.2

func (t FullTextTokenizer) Name() string

func (FullTextTokenizer) Tokens added in v0.8.2

func (t FullTextTokenizer) Tokens(sv types.Val) ([]string, error)

func (FullTextTokenizer) Type added in v0.8.2

func (t FullTextTokenizer) Type() types.TypeID

type GeoTokenizer added in v0.7.3

type GeoTokenizer struct{}

func (GeoTokenizer) Identifier added in v0.8.2

func (t GeoTokenizer) Identifier() byte

func (GeoTokenizer) IsLossy added in v0.8.2

func (t GeoTokenizer) IsLossy() bool

func (GeoTokenizer) IsSortable added in v0.8.2

func (t GeoTokenizer) IsSortable() bool

func (GeoTokenizer) Name added in v0.7.3

func (t GeoTokenizer) Name() string

func (GeoTokenizer) Tokens added in v0.7.3

func (t GeoTokenizer) Tokens(sv types.Val) ([]string, error)

func (GeoTokenizer) Type added in v0.7.3

func (t GeoTokenizer) Type() types.TypeID

type HashTokenizer added in v0.8.2

type HashTokenizer struct{}

func (HashTokenizer) Identifier added in v0.8.2

func (t HashTokenizer) Identifier() byte

func (HashTokenizer) IsLossy added in v0.8.2

func (t HashTokenizer) IsLossy() bool

func (HashTokenizer) IsSortable added in v0.8.2

func (t HashTokenizer) IsSortable() bool

func (HashTokenizer) Name added in v0.8.2

func (t HashTokenizer) Name() string

func (HashTokenizer) Tokens added in v0.8.2

func (t HashTokenizer) Tokens(sv types.Val) ([]string, error)

func (HashTokenizer) Type added in v0.8.2

func (t HashTokenizer) Type() types.TypeID

type HourTokenizer added in v0.8.2

type HourTokenizer struct{}

func (HourTokenizer) Identifier added in v0.8.2

func (t HourTokenizer) Identifier() byte

func (HourTokenizer) IsLossy added in v0.8.2

func (t HourTokenizer) IsLossy() bool

func (HourTokenizer) IsSortable added in v0.8.2

func (t HourTokenizer) IsSortable() bool

func (HourTokenizer) Name added in v0.8.2

func (t HourTokenizer) Name() string

func (HourTokenizer) Tokens added in v0.8.2

func (t HourTokenizer) Tokens(sv types.Val) ([]string, error)

func (HourTokenizer) Type added in v0.8.2

func (t HourTokenizer) Type() types.TypeID

type IntTokenizer added in v0.8.2

type IntTokenizer struct{}

func (IntTokenizer) Identifier added in v0.8.2

func (t IntTokenizer) Identifier() byte

func (IntTokenizer) IsLossy added in v0.8.2

func (t IntTokenizer) IsLossy() bool

func (IntTokenizer) IsSortable added in v0.8.2

func (t IntTokenizer) IsSortable() bool

func (IntTokenizer) Name added in v0.8.2

func (t IntTokenizer) Name() string

func (IntTokenizer) Tokens added in v0.8.2

func (t IntTokenizer) Tokens(sv types.Val) ([]string, error)

func (IntTokenizer) Type added in v0.8.2

func (t IntTokenizer) Type() types.TypeID

type MonthTokenizer added in v0.8.2

type MonthTokenizer struct{}

func (MonthTokenizer) Identifier added in v0.8.2

func (t MonthTokenizer) Identifier() byte

func (MonthTokenizer) IsLossy added in v0.8.2

func (t MonthTokenizer) IsLossy() bool

func (MonthTokenizer) IsSortable added in v0.8.2

func (t MonthTokenizer) IsSortable() bool

func (MonthTokenizer) Name added in v0.8.2

func (t MonthTokenizer) Name() string

func (MonthTokenizer) Tokens added in v0.8.2

func (t MonthTokenizer) Tokens(sv types.Val) ([]string, error)

func (MonthTokenizer) Type added in v0.8.2

func (t MonthTokenizer) Type() types.TypeID

type TermTokenizer added in v0.7.3

type TermTokenizer struct{}

func (TermTokenizer) Identifier added in v0.8.2

func (t TermTokenizer) Identifier() byte

func (TermTokenizer) IsLossy added in v0.8.2

func (t TermTokenizer) IsLossy() bool

func (TermTokenizer) IsSortable added in v0.8.2

func (t TermTokenizer) IsSortable() bool

func (TermTokenizer) Name added in v0.7.3

func (t TermTokenizer) Name() string

func (TermTokenizer) Tokens added in v0.7.3

func (t TermTokenizer) Tokens(sv types.Val) ([]string, error)

func (TermTokenizer) Type added in v0.7.3

func (t TermTokenizer) Type() types.TypeID

type Tokenizer

type Tokenizer interface {

	// Name is name of tokenizer. This should be unique.
	Name() string

	// Type returns typeID that we care about.
	Type() types.TypeID

	// Tokens return tokens for a given value.
	Tokens(sv types.Val) ([]string, error)

	// Identifier returns the prefix byte for this token type.
	Identifier() byte

	// IsSortable returns true if the tokenizer can be used for sorting/ordering.
	IsSortable() bool

	// IsLossy() returns true if we don't store the values directly as index keys
	// during tokenization. If a predicate is tokenized using an IsLossy() tokenizer,
	// then we need to fetch the actual value and compare.
	IsLossy() bool
}

Tokenizer defines what a tokenizer must provide.

func GetTokenizer added in v0.7.3

func GetTokenizer(name string) (Tokenizer, bool)

GetTokenizer returns tokenizer given unique name.

type TrigramTokenizer added in v0.8.2

type TrigramTokenizer struct{}

func (TrigramTokenizer) Identifier added in v0.8.2

func (t TrigramTokenizer) Identifier() byte

func (TrigramTokenizer) IsLossy added in v0.8.2

func (t TrigramTokenizer) IsLossy() bool

func (TrigramTokenizer) IsSortable added in v0.8.2

func (t TrigramTokenizer) IsSortable() bool

func (TrigramTokenizer) Name added in v0.8.2

func (t TrigramTokenizer) Name() string

func (TrigramTokenizer) Tokens added in v0.8.2

func (t TrigramTokenizer) Tokens(sv types.Val) ([]string, error)

func (TrigramTokenizer) Type added in v0.8.2

func (t TrigramTokenizer) Type() types.TypeID

type YearTokenizer added in v0.8.2

type YearTokenizer struct{}

func (YearTokenizer) Identifier added in v0.8.2

func (t YearTokenizer) Identifier() byte

func (YearTokenizer) IsLossy added in v0.8.2

func (t YearTokenizer) IsLossy() bool

func (YearTokenizer) IsSortable added in v0.8.2

func (t YearTokenizer) IsSortable() bool

func (YearTokenizer) Name added in v0.8.2

func (t YearTokenizer) Name() string

func (YearTokenizer) Tokens added in v0.8.2

func (t YearTokenizer) Tokens(sv types.Val) ([]string, error)

func (YearTokenizer) Type added in v0.8.2

func (t YearTokenizer) Type() types.TypeID

Jump to

Keyboard shortcuts

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