Documentation
¶
Index ¶
- Variables
- func GetCognates(graph *cayley.Handle, lang string, word string) map[string]*Cognate
- func GetGraph(path string) (*cayley.Handle, error)
- func GetGraphNquads(path string) (*cayley.Handle, error)
- func GetIndex(path string) (*radix.Tree, error)
- func GetSplitFiles(pathTemplate string) (files []*os.File, err error)
- func GetWords(path string) (map[string]*Word, error)
- func NewLexer(input string) *lexer
- func NewLexer2(input string, debug bool) *lexer
- func Normalize(w string) string
- func ParseXMLPage(r io.ReadCloser, title string, page chan<- Page, errors chan<- Error, ...)
- func ParseXMLPages(r io.ReadCloser, pages chan<- Page, errors chan<- Error, ...)
- func ParseXMLWords(r io.ReadCloser, words chan<- Word, descendants chan<- Descendants, ...)
- func QueryGraph(g *cayley.Handle, p *path.Path) (rs []string, ts []string, err error)
- func ReadGob(path string, data interface{}) error
- func ShouldIndex(word *Word) bool
- func WriteGob(p string, data interface{}, verbose bool, shouldBackup bool) error
- type Cognate
- type Definition
- type Definitions
- type Descendants
- type Error
- type Etymology
- type FormTemplate
- type FormTemplateType
- type Language
- type LinkBuffer
- type ListItem
- type Page
- type Pos
- type Redirect
- type RootWord
- type TextBuffer
- type Word
Constants ¶
This section is empty.
Variables ¶
View Source
var SourceLangs = map[string]bool{}
Functions ¶
func GetCognates ¶
func GetGraphNquads ¶
GetGraphNquads returns graph from nquads file
func NewLexer ¶
func NewLexer(input string) *lexer
NewLexer creates a new scanner for the input string.
func ParseXMLPage ¶
func ParseXMLPage(r io.ReadCloser, title string, page chan<- Page, errors chan<- Error, done chan<- io.ReadCloser)
ParseXMLPage returns page for cmd/gtpage.
func ParseXMLPages ¶
func ParseXMLPages(r io.ReadCloser, pages chan<- Page, errors chan<- Error, done chan<- io.ReadCloser)
ParseXMLPages returns pages for cmd/gtsplit.
func ParseXMLWords ¶
func ParseXMLWords(r io.ReadCloser, words chan<- Word, descendants chan<- Descendants, errors chan<- Error, done chan<- io.ReadCloser)
ParseXMLWords returns words and descendants for cmd/gtparse.
func QueryGraph ¶
QueryGraph queries graph.
func ShouldIndex ¶
Types ¶
type Definition ¶
type Definitions ¶
type Definitions struct { Nouns []Definition `json:"nouns,omitempty" firestore:"nouns,omitempty"` Adjectives []Definition `json:"adjectives,omitempty" firestore:"adjectives,omitempty"` Verbs []Definition `json:"verbs,omitempty" firestore:"verbs,omitempty"` Adverbs []Definition `json:"adverbs,omitempty" firestore:"adverbs,omitempty"` Articles []Definition `json:"articles,omitempty" firestore:"articles,omitempty"` Prepositions []Definition `json:"prepositions,omitempty" firestore:"prepositions,omitempty"` Pronouns []Definition `json:"pronouns,omitempty" firestore:"pronouns,omitempty"` Conjunctions []Definition `json:"conjunctions,omitempty" firestore:"conjunctions,omitempty"` Interjections []Definition `json:"interjections,omitempty" firestore:"interjections,omitempty"` Numerals []Definition `json:"numerals,omitempty" firestore:"numerals,omitempty"` Numbers []Definition `json:"numbers,omitempty" firestore:"numbers,omitempty"` Particles []Definition `json:"particles,omitempty" firestore:"particles,omitempty"` Determiners []Definition `json:"determiners,omitempty" firestore:"determiners,omitempty"` }
type Descendants ¶
type Descendants struct { Word string Links []tpl.Link Descendants []tpl.Descendant }
func ParseEtymTree ¶
func ParseEtymTree(p Page, langMap map[string]bool) (*Descendants, error)
Parses a given etymology tree (e.g. https://en.wiktionary.org/wiki/Template:etymtree/la/germanus)
type Etymology ¶
type Etymology struct { Cognates []tpl.Cognate `json:"cognates,omitempty" firestore:"cognates,omitempty"` Mentions []tpl.Mention `json:"mentions,omitempty" firestore:"mentions,omitempty"` Borrows []tpl.Borrow `json:"borrows,omitempty" firestore:"borrows,omitempty"` Derived []tpl.Derived `json:"derived,omitempty" firestore:"derived,omitempty"` Inherited []tpl.Inherited `json:"inherited,omitempty" firestore:"inherited,omitempty"` Prefixes []tpl.Prefix `json:"prefixes,omitempty" firestore:"prefixes,omitempty"` Suffixes []tpl.Suffix `json:"suffixes,omitempty" firestore:"suffixes,omitempty"` Links []tpl.Link `json:"links,omitempty" firestore:"links,omitempty"` }
type FormTemplate ¶
type FormTemplateType ¶
type FormTemplateType string
type Language ¶
type Language struct { Code string `firestore:"code"` Definitions *Definitions `json:"definitions,omitempty" firestore:"definitions,omitempty"` Etymology *Etymology `json:"etymology,omitempty" firestore:"etymology,omitempty"` // TODO: Clean up Links / represent as descendants? // Partly used by legacy etymtree templates. Links are only used for descendants. Links []tpl.Link `json:"links,omitempty" firestore:"links,omitempty"` Descendants []tpl.Descendant `json:"descendants,omitempty" firestore:"descendants,omitempty"` // TODO: Rename EtymTrees. May need to re-write DB. DescendantTrees []tpl.EtymTree `json:"descendantTrees,omitempty" firestore:"descendantTrees,omitempty"` DescTrees []tpl.DescTree `json:"descTrees,omitempty" firestore:"descTrees,omitempty"` Cognates []*Cognate `json:"cognates,omitempty" firestore:"cognates,omitempty"` // contains filtered or unexported fields }
func (*Language) AllDefinitions ¶
func (l *Language) AllDefinitions() [][]Definition
type LinkBuffer ¶
type Pos ¶
type Pos int
Pos represents a byte position in the original input text from which this template was parsed.
type TextBuffer ¶
type TextBuffer []string
Click to show internal directories.
Click to hide internal directories.