Documentation ¶
Index ¶
- func CompileDictionary(xmlPath string, outputPath string) (int, error)
- func GetDictionaryBytesFromXML(xmlStr string) ([]byte, error)
- func GetDictionaryFromXML(xmlStr string) *types.DictionaryRepresentable
- func Lexicon(dict *types.Dictionary) []string
- func Lookup(request LookupRequest) [][]types.Entry
- func MergeDictionaries(dst *types.Dictionary, srcs ...*types.Dictionary) (*types.DictionaryRepresentable, error)
- func ReadDictionary(pathOrAlias string) (*types.Dictionary, error)
- func ReadDictionaryFromBytes(bytes []byte) (*types.Dictionary, error)
- func ReadDictionaryFromPath(path string) (*types.Dictionary, error)
- func Split(request SplitRequest) []types.Entry
- func WriteDictionaryFromXML(xmlStr, outputPath string) (int, error)
- func WriteDictionaryToDisk(outputPath string, dictionary *types.DictionaryRepresentable) (int, error)
- type LookupRequest
- type ODictFile
- type SplitRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileDictionary ¶
CompileDictionary compiles an XML file into an ODict binary
func GetDictionaryFromXML ¶
func GetDictionaryFromXML(xmlStr string) *types.DictionaryRepresentable
func Lexicon ¶
func Lexicon(dict *types.Dictionary) []string
Lexicon returns all originally-cased entries of a compiled dictionary
func Lookup ¶
func Lookup(request LookupRequest) [][]types.Entry
func MergeDictionaries ¶
func MergeDictionaries(dst *types.Dictionary, srcs ...*types.Dictionary) (*types.DictionaryRepresentable, error)
MergeDictionaries merges the entries of two dictionaries.
func ReadDictionary ¶
func ReadDictionary(pathOrAlias string) (*types.Dictionary, error)
ReadDictionary loads a compiled ODict dictionary from the provided path and returns a Dictionary model, with the ability to forcibly re-index the dictionary when it loads
func ReadDictionaryFromBytes ¶
func ReadDictionaryFromBytes(bytes []byte) (*types.Dictionary, error)
ReadDictionaryFromBytes loads a compiled ODict dictionary from the provided bytes and returns a Dictionary model, with the ability to forcibly re-index the dictionary when it loads
func ReadDictionaryFromPath ¶
func ReadDictionaryFromPath(path string) (*types.Dictionary, error)
ReadDictionaryFromPath loads a compiled ODict dictionary from the provided path and returns a Dictionary model, with the ability to forcibly re-index the dictionary when it loads
func Split ¶
func Split(request SplitRequest) []types.Entry
Split splits a query into definable tokens greater than or equal to the specified threshold Example: household -> house + hold
func WriteDictionaryFromXML ¶
WriteDictionary generates an ODict binary file given a ODXML input file path
func WriteDictionaryToDisk ¶
func WriteDictionaryToDisk(outputPath string, dictionary *types.DictionaryRepresentable) (int, error)
Types ¶
type LookupRequest ¶
type LookupRequest struct { Dictionary *types.Dictionary Queries []string Follow bool Split int }
type SplitRequest ¶
type SplitRequest struct { Dictionary *types.Dictionary Query string Threshold int }