odict

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Abbreviation = PartOfSpeech{Tag: "abbrev", Buf: POSabv, Label: "abbreviation"}
View Source
var Adfix = PartOfSpeech{Tag: "adf", Buf: POSadf, Label: "adfix"}
View Source
var AdjectivalPreNoun = PartOfSpeech{Tag: "adj-pn", Buf: POSadj_pn, Label: "pre-noun adjectival (rentaishi)"}
View Source
var Adjective = PartOfSpeech{Tag: "adj", Label: "adjective", Buf: POSadj}
View Source
var AdjectiveKari = PartOfSpeech{Tag: "adj-kari", Buf: POSadj_kari, Label: "'kari' adjective (archaic)"}
View Source
var AdjectiveKu = PartOfSpeech{Tag: "adj-ku", Buf: POSadj_ku, Label: "'ku' adjective (archaic)"}
View Source
var AdjectiveNari = PartOfSpeech{Tag: "adj-nari", Buf: POSadj_nari, Label: "archaic/formal form of na-adjective"}
View Source
var AdjectiveNoun = PartOfSpeech{Tag: "adj-na", Buf: POSadj_na, Label: "adjectival nouns or quasi-adjectives (keiyodoshi)"}
View Source
var AdjectivePhrase = PartOfSpeech{Tag: "phr_adj", Label: "adjective phrase", Buf: POSphr_adj}
View Source
var AdjectiveShiku = PartOfSpeech{Tag: "adj-shiku", Buf: POSadj_shiku, Label: "'shiku' adjective (archaic)"}
View Source
var AdjectiveTaru = PartOfSpeech{Tag: "adj-t", Buf: POSadj_t, Label: "'taru' adjective"}
View Source
var AdjectiveYoiIi = PartOfSpeech{Tag: "adj-ix", Buf: POSadj_ix, Label: "adjective (keiyoushi) - yoi/ii class"}
View Source
var Adverb = PartOfSpeech{Tag: "adv", Label: "adverb", Buf: POSadv}
View Source
var AdverbTo = PartOfSpeech{Tag: "adv-to", Buf: POSadv_to, Label: "adverb taking the 'to' particle"}
View Source
var AdverbialNoun = PartOfSpeech{Tag: "n-adv", Buf: POSn_adv, Label: "adverbial noun (fukushitekimeishi)"}
View Source
var AdverbialPhrase = PartOfSpeech{Tag: "phr_adv", Label: "adverbial phrase", Buf: POSphr_adv}
View Source
var Affix = PartOfSpeech{Tag: "aff", Buf: POSaff, Label: "affix"}
View Source
var Auxiliary = PartOfSpeech{Tag: "aux", Label: "auxiliary", Buf: POSaux}
View Source
var AuxiliaryAdjective = PartOfSpeech{Tag: "aux-adj", Buf: POSaux_adj, Label: "auxiliary adjective"}
View Source
var AuxiliaryVerb = PartOfSpeech{Tag: "aux-v", Buf: POSaux_v, Label: "auxiliary verb"}
View Source
var Character = PartOfSpeech{Tag: "chr", Label: "character", Buf: POSchr}
View Source
var Circumfix = PartOfSpeech{Tag: "crcf", Buf: POScf, Label: "circumfix"}
View Source
var Conjunction = PartOfSpeech{Tag: "conj", Buf: POSconj, Label: "conjunction"}
View Source
var CoordinatingConjunction = PartOfSpeech{Tag: "cconj", Buf: POSconj_c, Label: "coordinating conjunction"}
View Source
var Copula = PartOfSpeech{Tag: "cop", Buf: POScop, Label: "copula"}
View Source
var Counter = PartOfSpeech{Tag: "ctr", Buf: POSctr, Label: "counter"}
View Source
var Determiner = PartOfSpeech{Tag: "det", Buf: POSdet, Label: "determiner"}
View Source
var EnumNamesPOS = map[POS]string{}/* 114 elements not displayed */
View Source
var EnumValuesPOS = map[string]POS{}/* 114 elements not displayed */
View Source
var Expression = PartOfSpeech{Tag: "expr", Buf: POSexpr, Label: "expression"}
View Source
var Infix = PartOfSpeech{Tag: "inf", Buf: POSinf, Label: "infix"}
View Source
var Interfix = PartOfSpeech{Tag: "intf", Buf: POSintf, Label: "interfix"}
View Source
var Interjection = PartOfSpeech{Tag: "intj", Buf: POSintj, Label: "interjection"}
View Source
var IntransitiveVerb = PartOfSpeech{Tag: "vi", Buf: POSvi, Label: "intransitive verb"}
View Source
var Name = PartOfSpeech{Tag: "name", Buf: POSname, Label: "name"}
View Source
var Noun = PartOfSpeech{Tag: "n", Buf: POSn, Label: "noun"}
View Source
var NounNo = PartOfSpeech{Tag: "adj-no", Buf: POSadj_no, Label: "nouns which may take the genitive case particle 'no'"}
View Source
var NounPrefix = PartOfSpeech{Tag: "n-pref", Buf: POSn_pref, Label: "noun, used as a prefix"}
View Source
var NounSuffix = PartOfSpeech{Tag: "n-suf", Buf: POSn_suf, Label: "noun, used as a suffix"}
View Source
var NounTemporal = PartOfSpeech{Tag: "n-t", Buf: POSn_t, Label: "noun (temporal) (jisoumeishi)"}
View Source
var NounVerbPrenominal = PartOfSpeech{Tag: "adj-f", Buf: POSadj_f, Label: "noun or verb acting prenominally"}
View Source
var Numeric = PartOfSpeech{Tag: "num", Buf: POSnum, Label: "numeric"}
View Source
var Particle = PartOfSpeech{Tag: "part", Buf: POSpart, Label: "particle"}
View Source
var Phrase = PartOfSpeech{Tag: "phr", Buf: POSpart, Label: "phrase"}
View Source
var Postposition = PartOfSpeech{Tag: "postp", Buf: POSpostp, Label: "postposition"}
View Source
var Prefix = PartOfSpeech{Tag: "pref", Buf: POSpart, Label: "prefix"}
View Source
var Preposition = PartOfSpeech{Tag: "prep", Buf: POSprep, Label: "preposition"}
View Source
var PrepositionalPhrase = PartOfSpeech{Tag: "phr_prep", Label: "prepositional phrase", Buf: POSphr_adj}
View Source
var Pronoun = PartOfSpeech{Tag: "pron", Buf: POSpron, Label: "pronoun"}
View Source
var ProperNoun = PartOfSpeech{Tag: "propn", Buf: POSpropn, Label: "proper noun"}
View Source
var Proverb = PartOfSpeech{Tag: "prov", Buf: POSprov, Label: "proverb"}
View Source
var Punctuation = PartOfSpeech{Tag: "punc", Buf: POSpunc, Label: "punctuation"}
View Source
var SubordinatingConjunction = PartOfSpeech{Tag: "conj_s", Buf: POSconj_s, Label: "subordinating conjunction"}
View Source
var Suffix = PartOfSpeech{Tag: "suff", Buf: POSsuff, Label: "suffix"}
View Source
var Symbol = PartOfSpeech{Tag: "sym", Buf: POSsym, Label: "symbol"}
View Source
var TransitiveVerb = PartOfSpeech{Tag: "vt", Buf: POSvt, Label: "transitive verb"}
View Source
var Unknown = PartOfSpeech{Tag: "un", Buf: POSun, Label: "unknown"}
View Source
var Verb = PartOfSpeech{Tag: "v", Buf: POSv, Label: "verb"}
View Source
var VerbGodanBu = PartOfSpeech{Tag: "v5b", Buf: POSv5b, Label: "Godan verb with 'bu' ending"}
View Source
var VerbGodanGu = PartOfSpeech{Tag: "v5g", Buf: POSv5g, Label: "Godan verb with 'gu' ending"}
View Source
var VerbGodanKu = PartOfSpeech{Tag: "v5k", Buf: POSv5k, Label: "Godan verb with 'ku' ending"}
View Source
var VerbGodanMu = PartOfSpeech{Tag: "v5m", Buf: POSv5m, Label: "Godan verb with 'mu' ending"}
View Source
var VerbGodanNu = PartOfSpeech{Tag: "v5n", Buf: POSv5n, Label: "Godan verb with 'nu' ending"}
View Source
var VerbGodanRu = PartOfSpeech{Tag: "v5r", Buf: POSv5r, Label: "Godan verb with 'ru' ending"}
View Source
var VerbGodanRuIrregular = PartOfSpeech{Tag: "v5r-i", Buf: POSv5r_i, Label: "Godan verb with 'ru' ending (irregular verb)"}
View Source
var VerbGodanSpecialAru = PartOfSpeech{Tag: "v5aru", Buf: POSv5aru, Label: "Godan verb - -aru special class"}
View Source
var VerbGodanSpecialIkuYuku = PartOfSpeech{Tag: "v5k-s", Buf: POSv5k_s, Label: "Godan verb - Iku/Yuku special class"}
View Source
var VerbGodanSu = PartOfSpeech{Tag: "v5s", Buf: POSv5s, Label: "Godan verb with 'su' ending"}
View Source
var VerbGodanTsu = PartOfSpeech{Tag: "v5t", Buf: POSv5t, Label: "Godan verb with 'tsu' ending"}
View Source
var VerbGodanU = PartOfSpeech{Tag: "v5u", Buf: POSv5u, Label: "Godan verb with 'u' ending"}
View Source
var VerbGodanUSpecial = PartOfSpeech{Tag: "v5u-s", Buf: POSv5u_s, Label: "Godan verb with 'u' ending (special class)"}
View Source
var VerbGodanUruOldVerbOldFormOfEru = PartOfSpeech{Tag: "v5uru", Buf: POSv5uru, Label: "Godan verb - Uru old class verb (old form of Eru)"}
View Source
var VerbIchidan = PartOfSpeech{Tag: "v1", Buf: POSv1, Label: "Ichidan verb"}
View Source
var VerbIchidanSpecial = PartOfSpeech{Tag: "v1-s", Buf: POSv1_s, Label: "Ichidan verb - kureru special class"}
View Source
var VerbIchidanZuru = PartOfSpeech{Tag: "vz", Buf: POSvz, Label: "Ichidan verb - zuru verb (alternative form of -jiru verbs)"}
View Source
var VerbKuruSpecial = PartOfSpeech{Tag: "vk", Buf: POSvk, Label: "Kuru verb - special class"}
View Source
var VerbNidanBuLower = PartOfSpeech{Tag: "v2b-s", Buf: POSv2b_s, Label: "Nidan verb (lower class) with 'bu' ending (archaic)"}
View Source
var VerbNidanBuUpper = PartOfSpeech{Tag: "v2b-k", Buf: POSv2b_k, Label: "Nidan verb (upper class) with 'bu' ending (archaic)"}
View Source
var VerbNidanDzuLower = PartOfSpeech{Tag: "v2d-s", Buf: POSv2d_s, Label: "Nidan verb (lower class) with 'dzu' ending (archaic)"}
View Source
var VerbNidanDzuUpper = PartOfSpeech{Tag: "v2d-k", Buf: POSv2d_k, Label: "Nidan verb (upper class) with 'dzu' ending (archaic)"}
View Source
var VerbNidanGuLower = PartOfSpeech{Tag: "v2g-s", Buf: POSv2g_s, Label: "Nidan verb (lower class) with 'gu' ending (archaic)"}
View Source
var VerbNidanGuUpper = PartOfSpeech{Tag: "v2g-k", Buf: POSv2g_k, Label: "Nidan verb (upper class) with 'gu' ending (archaic)"}
View Source
var VerbNidanHuFuLower = PartOfSpeech{Tag: "v2h-s", Buf: POSv2h_s, Label: "Nidan verb (lower class) with 'hu/fu' ending (archaic)"}
View Source
var VerbNidanHuFuUpper = PartOfSpeech{Tag: "v2h-k", Buf: POSv2h_k, Label: "Nidan verb (upper class) with 'hu/fu' ending (archaic)"}
View Source
var VerbNidanKuLower = PartOfSpeech{Tag: "v2k-s", Buf: POSv2k_s, Label: "Nidan verb (lower class) with 'ku' ending (archaic)"}
View Source
var VerbNidanKuUpper = PartOfSpeech{Tag: "v2k-k", Buf: POSv2k_k, Label: "Nidan verb (upper class) with 'ku' ending (archaic)"}
View Source
var VerbNidanMuLower = PartOfSpeech{Tag: "v2m-s", Buf: POSv2m_s, Label: "Nidan verb (lower class) with 'mu' ending (archaic)"}
View Source
var VerbNidanMuUpper = PartOfSpeech{Tag: "v2m-k", Buf: POSv2m_k, Label: "Nidan verb (upper class) with 'mu' ending (archaic)"}
View Source
var VerbNidanNuLower = PartOfSpeech{Tag: "v2n-s", Buf: POSv2n_s, Label: "Nidan verb (lower class) with 'nu' ending (archaic)"}
View Source
var VerbNidanRuLower = PartOfSpeech{Tag: "v2r-s", Buf: POSv2r_s, Label: "Nidan verb (lower class) with 'ru' ending (archaic)"}
View Source
var VerbNidanRuUpper = PartOfSpeech{Tag: "v2r-k", Buf: POSv2r_k, Label: "Nidan verb (upper class) with 'ru' ending (archaic)"}
View Source
var VerbNidanSuLower = PartOfSpeech{Tag: "v2s-s", Buf: POSv2s_s, Label: "Nidan verb (lower class) with 'su' ending (archaic)"}
View Source
var VerbNidanTsuLower = PartOfSpeech{Tag: "v2t-s", Buf: POSv2t_s, Label: "Nidan verb (lower class) with 'tsu' ending (archaic)"}
View Source
var VerbNidanTsuUpper = PartOfSpeech{Tag: "v2t-k", Buf: POSv2t_k, Label: "Nidan verb (upper class) with 'tsu' ending (archaic)"}
View Source
var VerbNidanU = PartOfSpeech{Tag: "v2a-s", Buf: POSv2a_s, Label: "Nidan verb with 'u' ending (archaic)"}
View Source
var VerbNidanUWeLower = PartOfSpeech{Tag: "v2w-s", Buf: POSv2w_s, Label: "Nidan verb (lower class) with 'u' ending and 'we' conjugation (archaic)"}
View Source
var VerbNidanYuLower = PartOfSpeech{Tag: "v2y-s", Buf: POSv2y_s, Label: "Nidan verb (lower class) with 'yu' ending (archaic)"}
View Source
var VerbNidanYuUpper = PartOfSpeech{Tag: "v2y-k", Buf: POSv2y_k, Label: "Nidan verb (upper class) with 'yu' ending (archaic)"}
View Source
var VerbNidanZuLower = PartOfSpeech{Tag: "v2z-s", Buf: POSv2z_s, Label: "Nidan verb (lower class) with 'zu' ending (archaic)"}
View Source
var VerbNuIrregular = PartOfSpeech{Tag: "vn", Buf: POSvn, Label: "irregular nu verb"}
View Source
var VerbRuIrregular = PartOfSpeech{Tag: "vr", Buf: POSvr, Label: "irregular ru verb, plain form ends with -ri"}
View Source
var VerbSu = PartOfSpeech{Tag: "vs-c", Buf: POSvs_c, Label: "su verb - precursor to the modern suru"}
View Source
var VerbSuru = PartOfSpeech{Tag: "vs", Buf: POSvs, Label: "noun or participle which takes the aux. verb suru"}
View Source
var VerbSuruIncluded = PartOfSpeech{Tag: "vs-i", Buf: POSvs_i, Label: "suru verb - included"}
View Source
var VerbSuruSpecial = PartOfSpeech{Tag: "vs-s", Buf: POSvs_s, Label: "suru verb - special class"}
View Source
var VerbUnspecified = PartOfSpeech{Tag: "v-unspec", Buf: POSv_unspec, Label: "verb unspecified"}
View Source
var VerbYodanBu = PartOfSpeech{Tag: "v4b", Buf: POSv4b, Label: "Yodan verb with 'bu' ending (archaic)"}
View Source
var VerbYodanGu = PartOfSpeech{Tag: "v4g", Buf: POSv4g, Label: "Yodan verb with 'gu' ending (archaic)"}
View Source
var VerbYodanHuFu = PartOfSpeech{Tag: "v4h", Buf: POSv4h, Label: "Yodan verb with 'hu/fu' ending (archaic)"}
View Source
var VerbYodanKu = PartOfSpeech{Tag: "v4k", Buf: POSv4k, Label: "Yodan verb with 'ku' ending (archaic)"}
View Source
var VerbYodanMu = PartOfSpeech{Tag: "v4m", Buf: POSv4m, Label: "Yodan verb with 'mu' ending (archaic)"}
View Source
var VerbYodanNu = PartOfSpeech{Tag: "v4n", Buf: POSv4n, Label: "Yodan verb with 'nu' ending (archaic)"}
View Source
var VerbYodanRu = PartOfSpeech{Tag: "v4r", Buf: POSv4r, Label: "Yodan verb with 'ru' ending (archaic)"}
View Source
var VerbYodanSu = PartOfSpeech{Tag: "v4s", Buf: POSv4s, Label: "Yodan verb with 'su' ending (archaic)"}
View Source
var VerbYodanTsu = PartOfSpeech{Tag: "v4t", Buf: POSv4t, Label: "Yodan verb with 'tsu' ending (archaic)"}

Functions

func Assert

func Assert(condition bool, errorMessage string)

Assert exits the program if a condition is not met

func Check

func Check(e error)

Check exits the program if an error exists

func CleanupTest

func CleanupTest()

func CompileDictionary

func CompileDictionary(xmlPath string, outputPath string) int

CompileDictionary compiles an XML file into an ODict binary

func DefinitionAddExamples

func DefinitionAddExamples(builder *flatbuffers.Builder, examples flatbuffers.UOffsetT)

func DefinitionAddId

func DefinitionAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT)

func DefinitionAddValue

func DefinitionAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT)

func DefinitionEnd

func DefinitionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func DefinitionStart

func DefinitionStart(builder *flatbuffers.Builder)

func DefinitionStartExamplesVector

func DefinitionStartExamplesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func DictionaryAddEntries

func DictionaryAddEntries(builder *flatbuffers.Builder, entries flatbuffers.UOffsetT)

func DictionaryAddId

func DictionaryAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT)

func DictionaryAddName

func DictionaryAddName(builder *flatbuffers.Builder, name flatbuffers.UOffsetT)

func DictionaryEnd

func DictionaryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func DictionaryStart

func DictionaryStart(builder *flatbuffers.Builder)

func DictionaryStartEntriesVector

func DictionaryStartEntriesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func EncodeDictionary

func EncodeDictionary(dictionary Dictionary) []byte

EncodeDictionary encodes a dictionary struct into a byte array

func EncodeEntry

func EncodeEntry(entry Entry) []byte

EncodeDictionary encodes an entry struct into a byte array

func EntryAddEtymologies

func EntryAddEtymologies(builder *flatbuffers.Builder, etymologies flatbuffers.UOffsetT)

func EntryAddKey

func EntryAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT)

func EntryAddPronunciation added in v1.9.0

func EntryAddPronunciation(builder *flatbuffers.Builder, pronunciation flatbuffers.UOffsetT)

func EntryAddSee added in v1.7.0

func EntryAddSee(builder *flatbuffers.Builder, see flatbuffers.UOffsetT)

func EntryAddTerm

func EntryAddTerm(builder *flatbuffers.Builder, term flatbuffers.UOffsetT)

func EntryEnd

func EntryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func EntryKeyCompare added in v1.7.0

func EntryKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool

func EntryStart

func EntryStart(builder *flatbuffers.Builder)

func EntryStartEtymologiesVector

func EntryStartEtymologiesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func EtymologyAddDescription

func EtymologyAddDescription(builder *flatbuffers.Builder, description flatbuffers.UOffsetT)

func EtymologyAddId

func EtymologyAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT)

func EtymologyAddUsages

func EtymologyAddUsages(builder *flatbuffers.Builder, usages flatbuffers.UOffsetT)

func EtymologyEnd

func EtymologyEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func EtymologyStart

func EtymologyStart(builder *flatbuffers.Builder)

func EtymologyStartUsagesVector

func EtymologyStartUsagesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func GroupAddDefinitions

func GroupAddDefinitions(builder *flatbuffers.Builder, definitions flatbuffers.UOffsetT)

func GroupAddDescription

func GroupAddDescription(builder *flatbuffers.Builder, description flatbuffers.UOffsetT)

func GroupAddId

func GroupAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT)

func GroupEnd

func GroupEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func GroupStart

func GroupStart(builder *flatbuffers.Builder)

func GroupStartDefinitionsVector

func GroupStartDefinitionsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func JSON

func JSON(any interface{}) string

func Map

func Map[T any, V any](array []T, f func(T) V) []V

Map maps any array of type T to an array of type V

func Uint16ToBytes

func Uint16ToBytes(n uint16) []byte

Uint16ToBytes converts a uint16 type to a byte array

func Uint64ToBytes

func Uint64ToBytes(n uint64) []byte

Uint64ToBytes converts a uint64 type to a byte array

func UsageAddDefinitions

func UsageAddDefinitions(builder *flatbuffers.Builder, definitions flatbuffers.UOffsetT)

func UsageAddGroups

func UsageAddGroups(builder *flatbuffers.Builder, groups flatbuffers.UOffsetT)

func UsageAddPos

func UsageAddPos(builder *flatbuffers.Builder, pos POS)

func UsageEnd

func UsageEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func UsageKeyCompare added in v1.7.0

func UsageKeyCompare(o1, o2 flatbuffers.UOffsetT, buf []byte) bool

func UsageStart

func UsageStart(builder *flatbuffers.Builder)

func UsageStartDefinitionsVector

func UsageStartDefinitionsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func UsageStartGroupsVector

func UsageStartGroupsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT

func WriteDictionaryFromExisting

func WriteDictionaryFromExisting(outputPath string, dictionary DictionaryRepresentable) int

func WriteDictionaryFromXML

func WriteDictionaryFromXML(xmlStr, outputPath string) int

WriteDictionary generates an ODict binary file given a ODXML input file path

func XML added in v1.7.0

func XML(any interface{}) string

Types

type DEFINITIONS added in v1.10.0

type DEFINITIONS struct {
	sq.TableStruct
	ID       sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
	TEXT     sq.StringField `ddl:"notnull"`
	USAGE_ID sq.NumberField `ddl:"type=BIGINT references=usages.id"`
	GROUP_ID sq.NumberField `ddl:"type=BIGINT references=groups.id"`
}

type DICTIONARIES added in v1.10.0

type DICTIONARIES struct {
	sq.TableStruct
	ID   sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
	NAME sq.StringField `ddl:"notnull"`
}

type Definition

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

func GetRootAsDefinition

func GetRootAsDefinition(buf []byte, offset flatbuffers.UOffsetT) *Definition

func GetSizePrefixedRootAsDefinition

func GetSizePrefixedRootAsDefinition(buf []byte, offset flatbuffers.UOffsetT) *Definition

func (*Definition) AsRepresentable

func (definition *Definition) AsRepresentable() DefinitionRepresentable

func (*Definition) Examples

func (rcv *Definition) Examples(j int) []byte

func (*Definition) ExamplesLength

func (rcv *Definition) ExamplesLength() int

func (*Definition) Id

func (rcv *Definition) Id() []byte

func (*Definition) Init

func (rcv *Definition) Init(buf []byte, i flatbuffers.UOffsetT)

func (*Definition) Table

func (rcv *Definition) Table() flatbuffers.Table

func (*Definition) Value

func (rcv *Definition) Value() []byte

type DefinitionRepresentable

type DefinitionRepresentable struct {
	ID       string   `json:"id,omitempty" xml:"id,attr"`
	Value    string   `json:"value,omitempty" xml:"value,attr"`
	Examples []string `json:"examples,omitempty" xml:"example"`
}

func (*DefinitionRepresentable) AsBuffer

type Dictionary

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

func DecodeDictionary

func DecodeDictionary(b []byte) Dictionary

DecodeDictionary decodes a byte array into a dictionary object

func GetRootAsDictionary

func GetRootAsDictionary(buf []byte, offset flatbuffers.UOffsetT) *Dictionary

func GetSizePrefixedRootAsDictionary

func GetSizePrefixedRootAsDictionary(buf []byte, offset flatbuffers.UOffsetT) *Dictionary

func ReadDictionaryFromPath

func ReadDictionaryFromPath(path string) *Dictionary

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 (*Dictionary) AsRepresentable

func (dict *Dictionary) AsRepresentable() DictionaryRepresentable

func (*Dictionary) DumpSQL added in v1.10.0

func (dict *Dictionary) DumpSQL(sqlDialect SqlDialect) string

DumpDictionarySQL converts an Dictionary struct to SQL output to seed a database

func (*Dictionary) DumpXML added in v1.10.0

func (dict *Dictionary) DumpXML() string

DumpDictionaryXML converts an Dictionary struct to its original ODXML

func (*Dictionary) Entries

func (rcv *Dictionary) Entries(obj *Entry, j int) bool

func (*Dictionary) EntriesByKey added in v1.7.0

func (rcv *Dictionary) EntriesByKey(obj *Entry, key string) bool

func (*Dictionary) EntriesLength

func (rcv *Dictionary) EntriesLength() int

func (*Dictionary) Id

func (rcv *Dictionary) Id() []byte

func (*Dictionary) Index

func (dict *Dictionary) Index(overwrite bool, quiet bool) string

func (*Dictionary) Init

func (rcv *Dictionary) Init(buf []byte, i flatbuffers.UOffsetT)

func (*Dictionary) Lexicon added in v1.7.0

func (dict *Dictionary) Lexicon() []string

Lexicon returns all originally-cased entries of a compiled dictionary

func (*Dictionary) Lookup

func (dict *Dictionary) Lookup(queries []string, split int, follow bool) [][]Entry

func (*Dictionary) Name

func (rcv *Dictionary) Name() []byte

func (*Dictionary) Split

func (dict *Dictionary) Split(query string, threshold int) []Entry

Split splits a query into definable tokens greater than or equal to the specified threshold Example: household -> house + hold

func (*Dictionary) Table

func (rcv *Dictionary) Table() flatbuffers.Table

type DictionaryRepresentable

type DictionaryRepresentable struct {
	ID      string                            `json:"id" xml:"id,attr"`
	Name    string                            `json:"name" xml:"name,attr,omitempty"`
	Entries KVMap[string, EntryRepresentable] `json:"entries" xml:"entry"`
	XMLName xml.Name                          `json:"-" xml:"dictionary"`
}

func MergeDictionaries

func MergeDictionaries(dest *Dictionary, srcs ...*Dictionary) DictionaryRepresentable

MergeDictionaries merges the entries of two dictionaries.

func (*DictionaryRepresentable) AsBuffer

type ENTRIES added in v1.10.0

type ENTRIES struct {
	sq.TableStruct
	ID            sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
	CREATED_AT    sq.TimeField   `ddl:"default=CURRENT_TIMESTAMP"`
	UPDATED_AT    sq.TimeField
	TERM          sq.StringField `ddl:"notnull"`
	DICTIONARY_ID sq.NumberField `ddl:"type=BIGINT references=dictionaries.id"`
}

type ETYMOLOGIES added in v1.10.0

type ETYMOLOGIES struct {
	sq.TableStruct
	ID          sq.StringField `ddl:"primarykey"` // cuid() generation is handled by prisma, not the database.
	DESCRIPTION sq.StringField
	ENTRY_ID    sq.NumberField `ddl:"type=BIGINT notnull references=entries.id"`
}

type EXAMPLES added in v1.10.0

type EXAMPLES struct {
	sq.TableStruct
	ID            sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
	TEXT          sq.StringField `ddl:"notnull"`
	DEFINITION_ID sq.NumberField `ddl:"type=BIGINT notnull references=definitions.id"`
}

type Entry

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

func DecodeEntry

func DecodeEntry(b []byte) Entry

DecodeDictionary decodes a byte array into an entry object

func GetRootAsEntry

func GetRootAsEntry(buf []byte, offset flatbuffers.UOffsetT) *Entry

func GetSizePrefixedRootAsEntry

func GetSizePrefixedRootAsEntry(buf []byte, offset flatbuffers.UOffsetT) *Entry

func SearchDictionary

func SearchDictionary(dictionaryID string, queryStr string, exact bool) []Entry

SearchDictionary searches a dictionary model using Bleve using it's unique dictionary ID

func (*Entry) AsRepresentable

func (entry *Entry) AsRepresentable() EntryRepresentable

func (*Entry) Etymologies

func (rcv *Entry) Etymologies(obj *Etymology, j int) bool

func (*Entry) EtymologiesLength

func (rcv *Entry) EtymologiesLength() int

func (*Entry) Init

func (rcv *Entry) Init(buf []byte, i flatbuffers.UOffsetT)

func (*Entry) Key

func (rcv *Entry) Key() []byte

func (*Entry) LookupByKey added in v1.7.0

func (rcv *Entry) LookupByKey(key string, vectorLocation flatbuffers.UOffsetT, buf []byte) bool

func (*Entry) Pronunciation added in v1.9.0

func (rcv *Entry) Pronunciation() []byte

func (*Entry) See added in v1.7.0

func (rcv *Entry) See() []byte

func (*Entry) Table

func (rcv *Entry) Table() flatbuffers.Table

func (*Entry) Term

func (rcv *Entry) Term() []byte

type EntryRepresentable

type EntryRepresentable struct {
	Term          string                   `json:"term" xml:"term,attr"`
	Pronunciation string                   `json:"pronunciation,omitempty" xml:"pronunciation,attr,omitempty"`
	SeeAlso       string                   `json:"see,omitempty" xml:"see,attr,omitempty"`
	Etymologies   []EtymologyRepresentable `json:"etymologies" xml:"ety"`
	XMLName       xml.Name                 `json:"-" xml:"entry"`
}

func (*EntryRepresentable) AsBuffer

func (entry *EntryRepresentable) AsBuffer(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func (EntryRepresentable) Key

func (entry EntryRepresentable) Key() string

type Etymology

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

func GetRootAsEtymology

func GetRootAsEtymology(buf []byte, offset flatbuffers.UOffsetT) *Etymology

func GetSizePrefixedRootAsEtymology

func GetSizePrefixedRootAsEtymology(buf []byte, offset flatbuffers.UOffsetT) *Etymology

func (*Etymology) AsRepresentable

func (etymology *Etymology) AsRepresentable() EtymologyRepresentable

func (*Etymology) Description

func (rcv *Etymology) Description() []byte

func (*Etymology) Id

func (rcv *Etymology) Id() []byte

func (*Etymology) Init

func (rcv *Etymology) Init(buf []byte, i flatbuffers.UOffsetT)

func (*Etymology) Table

func (rcv *Etymology) Table() flatbuffers.Table

func (*Etymology) Usages

func (rcv *Etymology) Usages(obj *Usage, j int) bool

func (*Etymology) UsagesByKey added in v1.7.0

func (rcv *Etymology) UsagesByKey(obj *Usage, key POS) bool

func (*Etymology) UsagesLength

func (rcv *Etymology) UsagesLength() int

type EtymologyRepresentable

type EtymologyRepresentable struct {
	ID          string                                  `json:"id,omitempty" xml:"id,attr"`
	Description string                                  `json:"description,omitempty" xml:"description,attr,omitempty"`
	Usages      KVMap[PartOfSpeech, UsageRepresentable] `json:"usages" xml:"usage"`
}

func (*EtymologyRepresentable) AsBuffer

type GROUPS added in v1.10.0

type GROUPS struct {
	sq.TableStruct
	ID          sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
	DESCRIPTION sq.StringField
	USAGE_ID    sq.NumberField `ddl:"type=BIGINT notnull references=usages.id"`
}

type Group

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

func GetRootAsGroup

func GetRootAsGroup(buf []byte, offset flatbuffers.UOffsetT) *Group

func GetSizePrefixedRootAsGroup

func GetSizePrefixedRootAsGroup(buf []byte, offset flatbuffers.UOffsetT) *Group

func (*Group) AsRepresentable

func (group *Group) AsRepresentable() GroupRepresentable

func (*Group) Definitions

func (rcv *Group) Definitions(obj *Definition, j int) bool

func (*Group) DefinitionsLength

func (rcv *Group) DefinitionsLength() int

func (*Group) Description

func (rcv *Group) Description() []byte

func (*Group) Id

func (rcv *Group) Id() []byte

func (*Group) Init

func (rcv *Group) Init(buf []byte, i flatbuffers.UOffsetT)

func (*Group) Table

func (rcv *Group) Table() flatbuffers.Table

type GroupRepresentable

type GroupRepresentable struct {
	ID          string                    `json:"id,omitempty" xml:"id,attr"`
	Description string                    `json:"description" xml:"description,attr"`
	Definitions []DefinitionRepresentable `json:"definitions" xml:"definition"`
}

func (*GroupRepresentable) AsBuffer

func (group *GroupRepresentable) AsBuffer(builder *flatbuffers.Builder) flatbuffers.UOffsetT

type KVMap

type KVMap[K comparable, V Keyable[K]] map[K]V

func (KVMap[K, V]) MarshalXML

func (m KVMap[K, V]) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*KVMap[K, V]) UnmarshalXML

func (m *KVMap[K, V]) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Keyable

type Keyable[T comparable] interface {
	Key() T
}

type POS

type POS int8
const (
	POSun        POS = 0
	POSadj       POS = 1
	POSadv       POS = 2
	POSart       POS = 3
	POSconj      POS = 4
	POSintj      POS = 5
	POSn         POS = 6
	POSpart      POS = 7
	POSpref      POS = 8
	POSprep      POS = 9
	POSpostp     POS = 10
	POSpron      POS = 11
	POSsuff      POS = 12
	POSv         POS = 13
	POSabv       POS = 14
	POSadf       POS = 15
	POSaff       POS = 16
	POSaux_adj   POS = 17
	POSaux_v     POS = 18
	POSaux       POS = 19
	POSchr       POS = 20
	POSconj_c    POS = 21
	POSconj_s    POS = 22
	POScop       POS = 23
	POScf        POS = 24
	POSctr       POS = 25
	POSdet       POS = 26
	POSexpr      POS = 27
	POSinf       POS = 28
	POSintf      POS = 29
	POSname      POS = 30
	POSnum       POS = 31
	POSphr_adv   POS = 32
	POSphr_adj   POS = 33
	POSphr_prep  POS = 34
	POSphr       POS = 35
	POSpropn     POS = 36
	POSprov      POS = 37
	POSpunc      POS = 38
	POSsym       POS = 39
	POSvi        POS = 40
	POSvt        POS = 41
	POSadj_f     POS = 42
	POSadj_ix    POS = 43
	POSadj_kari  POS = 44
	POSadj_ku    POS = 45
	POSadj_na    POS = 46
	POSadj_nari  POS = 47
	POSadj_no    POS = 48
	POSadj_pn    POS = 49
	POSadj_shiku POS = 50
	POSadj_t     POS = 51
	POSadv_to    POS = 52
	POSn_adv     POS = 53
	POSn_pref    POS = 54
	POSn_suf     POS = 55
	POSn_t       POS = 56
	POSv_unspec  POS = 57
	POSv1_s      POS = 58
	POSv1        POS = 59
	POSv2a_s     POS = 60
	POSv2b_k     POS = 61
	POSv2b_s     POS = 62
	POSv2d_k     POS = 63
	POSv2d_s     POS = 64
	POSv2g_k     POS = 65
	POSv2g_s     POS = 66
	POSv2h_k     POS = 67
	POSv2h_s     POS = 68
	POSv2k_k     POS = 69
	POSv2k_s     POS = 70
	POSv2m_k     POS = 71
	POSv2m_s     POS = 72
	POSv2n_s     POS = 73
	POSv2r_k     POS = 74
	POSv2r_s     POS = 75
	POSv2s_s     POS = 76
	POSv2t_k     POS = 77
	POSv2t_s     POS = 78
	POSv2w_s     POS = 79
	POSv2y_k     POS = 80
	POSv2y_s     POS = 81
	POSv2z_s     POS = 82
	POSv4b       POS = 83
	POSv4g       POS = 84
	POSv4h       POS = 85
	POSv4k       POS = 86
	POSv4m       POS = 87
	POSv4n       POS = 88
	POSv4r       POS = 89
	POSv4s       POS = 90
	POSv4t       POS = 91
	POSv5aru     POS = 92
	POSv5b       POS = 93
	POSv5g       POS = 94
	POSv5k_s     POS = 95
	POSv5k       POS = 96
	POSv5m       POS = 97
	POSv5n       POS = 98
	POSv5r_i     POS = 99
	POSv5r       POS = 100
	POSv5s       POS = 101
	POSv5t       POS = 102
	POSv5u_s     POS = 103
	POSv5u       POS = 104
	POSv5uru     POS = 105
	POSvk        POS = 106
	POSvn        POS = 107
	POSvr        POS = 108
	POSvs_c      POS = 109
	POSvs_i      POS = 110
	POSvs_s      POS = 111
	POSvs        POS = 112
	POSvz        POS = 113
)

func (POS) String

func (v POS) String() string

type PartOfSpeech

type PartOfSpeech struct {
	Tag   string
	Label string
	Buf   POS
}

func (PartOfSpeech) MarshalText added in v1.8.0

func (p PartOfSpeech) MarshalText() ([]byte, error)

func (PartOfSpeech) MarshalXMLAttr added in v1.8.0

func (pos PartOfSpeech) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

func (*PartOfSpeech) UnmarshalText added in v1.8.0

func (p *PartOfSpeech) UnmarshalText(text []byte) error

func (*PartOfSpeech) UnmarshalXMLAttr added in v1.8.0

func (pos *PartOfSpeech) UnmarshalXMLAttr(attr xml.Attr) error

type Representable

type Representable interface {
	AsRepresentable() interface{}
}

type Serializable

type Serializable interface {
	AsBuffer(builder *flatbuffers.Builder) flatbuffers.UOffsetT
}

type SqlDialect added in v1.10.0

type SqlDialect = string
const (
	Postgres  SqlDialect = "postgres"
	Sqlite    SqlDialect = "sqlite"
	Mysql     SqlDialect = "mysql"
	Sqlserver SqlDialect = "sqlserver"
)

type USAGES added in v1.10.0

type USAGES struct {
	sq.TableStruct
	ID           sq.NumberField `ddl:"type=BIGINT primarykey auto_increment autoincrement identity"`
	ETYMOLOGY_ID sq.StringField `ddl:"notnull references=etymologies.id"`
}

type Usage

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

func GetRootAsUsage

func GetRootAsUsage(buf []byte, offset flatbuffers.UOffsetT) *Usage

func GetSizePrefixedRootAsUsage

func GetSizePrefixedRootAsUsage(buf []byte, offset flatbuffers.UOffsetT) *Usage

func (*Usage) AsRepresentable

func (usage *Usage) AsRepresentable() UsageRepresentable

func (*Usage) Definitions

func (rcv *Usage) Definitions(obj *Definition, j int) bool

func (*Usage) DefinitionsLength

func (rcv *Usage) DefinitionsLength() int

func (*Usage) Groups

func (rcv *Usage) Groups(obj *Group, j int) bool

func (*Usage) GroupsLength

func (rcv *Usage) GroupsLength() int

func (*Usage) Init

func (rcv *Usage) Init(buf []byte, i flatbuffers.UOffsetT)

func (*Usage) LookupByKey added in v1.7.0

func (rcv *Usage) LookupByKey(key POS, vectorLocation flatbuffers.UOffsetT, buf []byte) bool

func (*Usage) MutatePos

func (rcv *Usage) MutatePos(n POS) bool

func (*Usage) Pos

func (rcv *Usage) Pos() POS

func (*Usage) Table

func (rcv *Usage) Table() flatbuffers.Table

type UsageRepresentable

type UsageRepresentable struct {
	POS         PartOfSpeech              `json:"-" xml:"pos,attr"`
	Definitions []DefinitionRepresentable `json:"definitions,omitempty" xml:"definition"`
	Groups      []GroupRepresentable      `json:"groups,omitempty" xml:"group"`
	XMLName     xml.Name                  `json:"-" xml:"usage"`
}

func (*UsageRepresentable) AsBuffer

func (usage *UsageRepresentable) AsBuffer(builder *flatbuffers.Builder) flatbuffers.UOffsetT

func (UsageRepresentable) Key

func (usage UsageRepresentable) Key() PartOfSpeech

func (*UsageRepresentable) UnmarshalXML added in v1.8.3

func (ur *UsageRepresentable) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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