tok

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 7 Imported by: 201

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTokenizer added in v0.7.3

func RegisterTokenizer(t Tokenizer)

RegisterTokenizer adds your tokenizer to our list.

func SetDefault added in v0.7.3

func SetDefault(typ types.TypeID, name string)

SetDefault sets the default tokenizer for given typeID.

Types

type DateTimeTokenizer added in v0.7.3

type DateTimeTokenizer struct{}

func (DateTimeTokenizer) Name added in v0.7.3

func (t DateTimeTokenizer) Name() string

func (DateTimeTokenizer) Tokens added in v0.7.3

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

func (DateTimeTokenizer) Type added in v0.7.3

func (t DateTimeTokenizer) Type() types.TypeID

type DateTokenizer added in v0.7.3

type DateTokenizer struct{}

func (DateTokenizer) Name added in v0.7.3

func (t DateTokenizer) Name() string

func (DateTokenizer) Tokens added in v0.7.3

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

func (DateTokenizer) Type added in v0.7.3

func (t DateTokenizer) Type() types.TypeID

type ExactTokenizer added in v0.7.3

type ExactTokenizer struct{}

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) 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 GeoTokenizer added in v0.7.3

type GeoTokenizer struct{}

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 Int32Tokenizer added in v0.7.3

type Int32Tokenizer struct{}

func (Int32Tokenizer) Name added in v0.7.3

func (t Int32Tokenizer) Name() string

func (Int32Tokenizer) Tokens added in v0.7.3

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

func (Int32Tokenizer) Type added in v0.7.3

func (t Int32Tokenizer) Type() types.TypeID

type TermTokenizer added in v0.7.3

type TermTokenizer struct{}

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)
}

Tokenizer defines what a tokenizer must provide.

func Default added in v0.7.3

func Default(typ types.TypeID) Tokenizer

Default returns the default tokenizer for a given type.

func GetTokenizer added in v0.7.3

func GetTokenizer(name string) Tokenizer

GetTokenizer returns tokenizer given unique name.

Jump to

Keyboard shortcuts

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