Documentation ¶
Index ¶
- Constants
- Variables
- func DefiniteArticle(word string, nounArticle Article, isPlural bool, nounCase Case) string
- func IndefiniteArticle(word string, nounArticle Article, isPlural bool, nounCase Case) string
- func NewVerbP1(german string) string
- type Adjective
- func (a *Adjective) Decline(degree Degree, declension Declension, nounArticle Article, isPlural bool, ...) []string
- func (a *Adjective) GetComparative() []string
- func (a *Adjective) GetComparativeString(maxCount int) string
- func (a *Adjective) GetId() bson.ObjectId
- func (a *Adjective) GetScores() []*general.Score
- func (a *Adjective) GetSuperlative() []string
- func (a *Adjective) GetSuperlativeString(maxCount int) string
- func (a *Adjective) SetId(id bson.ObjectId)
- type Any
- type Argument
- type Article
- type Auxiliary
- type Case
- type Declension
- type DefaultWord
- func (w *DefaultWord) AddScore(score *general.Score)
- func (w *DefaultWord) GetCategory() string
- func (w *DefaultWord) GetEnglish() []Meaning
- func (w *DefaultWord) GetErrors() []string
- func (w *DefaultWord) GetGerman() string
- func (w *DefaultWord) GetId() bson.ObjectId
- func (w *DefaultWord) GetLearned() time.Time
- func (w *DefaultWord) GetScore() int
- func (w *DefaultWord) GetScores() []*general.Score
- func (w *DefaultWord) GetThird() []Meaning
- func (w *DefaultWord) GetUser() string
- func (w *DefaultWord) NewScore(result int)
- func (w *DefaultWord) SetId(id bson.ObjectId)
- type Degree
- type Meaning
- type Noun
- func (n *Noun) Decline(isPlural bool, nounCase Case) []string
- func (n *Noun) GetGenitives() []string
- func (n *Noun) GetGenitivesString(maxCount int) string
- func (n *Noun) GetId() bson.ObjectId
- func (n *Noun) GetPlurals() []string
- func (n *Noun) GetPluralsString(maxCount int) string
- func (n *Noun) GetScores() []*general.Score
- func (n *Noun) IsMixed() bool
- func (n *Noun) IsWeak() bool
- func (n *Noun) SetId(id bson.ObjectId)
- type PersonalPronoun
- type Prefix
- type Reflexive
- type Tense
- type Verb
- func (v *Verb) GetId() bson.ObjectId
- func (v *Verb) GetPresentP1() []string
- func (v *Verb) GetPresentP2() []string
- func (v *Verb) GetPresentP3() []string
- func (v *Verb) GetPresentS1() []string
- func (v *Verb) GetPresentS2() []string
- func (v *Verb) GetPresentS3() []string
- func (v *Verb) GetPreteriteP1() []string
- func (v *Verb) GetPreteriteP2() []string
- func (v *Verb) GetPreteriteP3() []string
- func (v *Verb) GetPreteriteS1() []string
- func (v *Verb) GetPreteriteS2() []string
- func (v *Verb) GetPreteriteS3() []string
- func (v *Verb) GetScores() []*general.Score
- func (v *Verb) GetSeparated(pp PersonalPronoun, tense Tense) [][2]string
- func (v *Verb) GetVerb(pp PersonalPronoun, tense Tense) []string
- func (v *Verb) GetVerbPresent(pp PersonalPronoun) []string
- func (v *Verb) GetVerbPreterite(pp PersonalPronoun) []string
- func (v *Verb) SetId(id bson.ObjectId)
- type Word
Constants ¶
View Source
const ( Positive Degree = 0 Comparative = 1 Superlative = 2 )
View Source
const ( Strong Declension = 0 Weak = 1 Mixed = 2 )
View Source
const ( Der Article = "r" Die = "e" Das = "s" )
View Source
const ( ReflexiveWithout Reflexive = "" ReflexiveAcusative = "A" ReflexiveDative = "D" )
View Source
const ( CaseNominative Case = "N" CaseAcusative = "A" CaseDative = "D" CaseGenitive = "G" )
View Source
const ( S1 PersonalPronoun = "S1" S2 = "S2" S3 = "S3" P1 = "P1" P2 = "P2" P3 = "P3" )
View Source
const ( Present Tense = "Present" Preterite = "Preterite" PastParticiple = "Past Participle" )
Variables ¶
View Source
var ( // Auxiliary: // ^ -- match beginning of string // ([sh]) -- match first auxiliary notion <-- s: sein, h: haben // (/([hs]))? -- match optional second auxiliary notion, followin a / sign // $ -- match end of string AuxiliaryRegexp = regexp.MustCompile("^([sh])(/([hs]))?$") // Argument: // ^ -- match beginning of string // ([^(]*) -- match any string that is not a open parantheses character // ? -- match optional space character // ( -- start of parantheses matching // [(] -- match open parantheses character // ([NADG]) -- match a case notion character <-- N: nominative, A: acusative, D: dative, G: genitive // [)] -- match close parantheses character // )? -- end of parantheses matching // * -- match optional spaces // $ -- match end of string ArgumentRegexp = regexp.MustCompile("^([^(]*) ?([(]([NADG])[)])? *$") // Verb: // ^ -- match beginning of string // ([A-ZÄÖÜßa-zäöü, ]+) -- match verb // ([A-ZÄÖÜßa-zäöü+() ]*)? -- match extension(s), separated by plus signs // $ -- match end of string VerbRegexp = regexp.MustCompile("^([A-ZÄÖÜßa-zäöü|,/ -]+)([A-ZÄÖÜßa-zäöü+()/ -]*)?$") )
View Source
var ( // Meaning: // ^ -- match beginning of string // ([^(]*) -- match any string that is not a open parantheses character // ? -- match optional space character // ( -- start of parantheses matching // [(] -- match open parantheses character // ([^)]*) -- match parantheses content // [)] -- match close parantheses character // )? -- end of parantheses matching // * -- match optional spaces // $ -- match end of string MeaningRegexp = regexp.MustCompile("^([^(]*) ?([(]([^)]*)[)])? *$") // German Word: // ^ -- match beginning of string // [a-zA-ZäÄöÖüÜß,.() ]* -- German words can only contain German letters, dots, parantheses and spaces // $ -- match end of string GermanRegexp = regexp.MustCompile("^[a-zA-ZäÄöÖüÜß,.() ]*$") )
View Source
var ( // Adjective: // ^ -- match beginning of string // ([a-zäöüß]+) -- match adjective // (,([a-zäöüß~⍨-]*))? -- match optional comparative, can be an extension only starting with a ⍨, ~ // (,([a-zäöüß~⍨-]*))? -- match optional superlative, can be an extension // $ -- match end of string AdjectiveRegexp = regexp.MustCompile("^([a-zäöüß]+)(,([a-zäöüß~⍨-]*))?(,([a-zäöüß~⍨-]*))?$") )
View Source
var ( // Article: // ^ -- match beginning of string // ([res]) -- match first article notion <-- r: der, e: die, s: das // (/([res]))? -- match optional second article notion, following a / sign // $ -- match end of string ArticleRegexp = regexp.MustCompile("^([res])(/([res]))?$") )
View Source
var ( // Noun: // ^ -- match beginning of string // ([A-ZÄÖÜ][A-ZÄÖÜßa-zäöü ]+) -- match noun in singular, must start with a capital // , -- match a comma // ([A-ZÄÖÜa-zäöü~⍨ -]*) -- match plural part, can be an extension only starting with a ⍨, ~ // (,([A-ZÄÖÜßa-zäöü~⍨ ]*()? -- match optional genitive, can be an extension // ([(]pl[)]) -- match plural only note // $ -- match end of string NounRegexp = regexp.MustCompile("^([A-ZÄÖÜ][A-ZÄÖÜßa-zäöü -]+),([A-ZÄÖÜa-zäöü~⍨/ -]*)(,([A-ZÄÖÜßa-zäöü~⍨/ -]*))?([(]pl[)])?$") )
Functions ¶
func DefiniteArticle ¶
func IndefiniteArticle ¶
Types ¶
type Adjective ¶
type Adjective struct { DefaultWord `bson:"word" json:"word,omitempty"` Comparative []string `bson:"comparative" json:"comparative,omitempty"` Superlative []string `bson:"superlative" json:"superlative,omitempty"` Id bson.ObjectId `bson:"_id,omitempty" json:"_id,omitempty"` }
func NewAdjective ¶
func (*Adjective) GetComparative ¶
func (*Adjective) GetComparativeString ¶
func (*Adjective) GetSuperlative ¶
func (*Adjective) GetSuperlativeString ¶
type Any ¶
type Any struct { DefaultWord `bson:"word" json:"word,omitempty"` Id bson.ObjectId `bson:"_id,omitempty" json:"_id,omitempty"` }
type Argument ¶
type Argument struct { Preposition string `bson:"prep" json:"prep,omitempty"` Case Case `bson:"case" json:"case,omitempty"` }
func NewArgument ¶
func NewArguments ¶
type Auxiliary ¶
type Auxiliary string
const ( Sein Auxiliary = "s" Haben = "h" )
func NewAuxiliary ¶
type Declension ¶
type Declension int
type DefaultWord ¶
type DefaultWord struct { German string `bson:"german" json:"german,omitempty"` English []Meaning `bson:"english" json:"english,omitempty"` Third []Meaning `bson:"third" json:"third,omitempty"` Category string `bson:"category" json:"category,omitempty"` User string `bson:"user" json:"user,omitempty"` Learned time.Time `bson:"learned" json:"learned,omitempty"` Score int `bson:"score" json:"score,omitempty"` Tags []string `bson:"tags" json:"tags,omitempty"` Errors []string `bson:"errors" json:"errors,omitempty"` Scores []*general.Score `bson:"scores" json:"scores,omitempty"` }
func NewDefaultWord ¶
func NewDefaultWord(german, english, third, category, user, learned, score, tags string, errors []string) DefaultWord
func (*DefaultWord) AddScore ¶
func (w *DefaultWord) AddScore(score *general.Score)
func (*DefaultWord) GetCategory ¶
func (w *DefaultWord) GetCategory() string
func (*DefaultWord) GetEnglish ¶
func (w *DefaultWord) GetEnglish() []Meaning
func (*DefaultWord) GetErrors ¶
func (w *DefaultWord) GetErrors() []string
func (*DefaultWord) GetGerman ¶
func (w *DefaultWord) GetGerman() string
func (*DefaultWord) GetId ¶
func (w *DefaultWord) GetId() bson.ObjectId
func (*DefaultWord) GetLearned ¶
func (w *DefaultWord) GetLearned() time.Time
func (*DefaultWord) GetScore ¶
func (w *DefaultWord) GetScore() int
func (*DefaultWord) GetScores ¶
func (w *DefaultWord) GetScores() []*general.Score
func (*DefaultWord) GetThird ¶
func (w *DefaultWord) GetThird() []Meaning
func (*DefaultWord) GetUser ¶
func (w *DefaultWord) GetUser() string
func (*DefaultWord) NewScore ¶
func (w *DefaultWord) NewScore(result int)
func (*DefaultWord) SetId ¶
func (w *DefaultWord) SetId(id bson.ObjectId)
type Meaning ¶
type Noun ¶
type Noun struct { DefaultWord `bson:"word" json:"word,omitempty"` Articles []Article `bson:"article" json:"article,omitempty"` Plural []string `bson:"plural" json:"plural,omitempty"` Genitive []string `bson:"genitive" json:"genitive,omitempty"` IsPluralOnly bool `bson:"plural_only" json:"plural_only,omitempty"` Id bson.ObjectId `bson:"_id,omitempty" json:"_id,omitempty"` }
func (*Noun) GetGenitives ¶
func (*Noun) GetGenitivesString ¶
func (*Noun) GetPlurals ¶
func (*Noun) GetPluralsString ¶
type PersonalPronoun ¶
type PersonalPronoun string
type Prefix ¶
type Verb ¶
type Verb struct { DefaultWord `bson:"word" json:"word,omitempty"` Auxiliary []Auxiliary `bson:"auxiliary" json:"auxiliary,omitempty"` Prefix Prefix `bson:"prefix" json:"prefix,omitempty"` Noun string `bson:"noun" json:"noun,omitempty"` Adjective string `bson:"adjective" json:"adjective,omitempty"` PastParticiple []string `bson:"pastParticiple" json:"pastParticiple,omitempty"` Preterite []string `bson:"preterite" json:"preterite,omitempty"` S1 []string `bson:"s1" json:"s1,omitempty"` S2 []string `bson:"s2" json:"s2,omitempty"` S3 []string `bson:"s3" json:"s3,omitempty"` P1 []string `bson:"p1" json:"p1,omitempty"` P2 []string `bson:"p2" json:"p2,omitempty"` P3 []string `bson:"p3" json:"p3,omitempty"` Reflexive Reflexive `bson:"reflexive" json:"reflexive,omitempty"` Arguments []Argument `bson:"arguments" json:"arguments,omitempty"` Id bson.ObjectId `bson:"_id,omitempty" json:"_id,omitempty"` }
func (*Verb) GetPresentP1 ¶
func (*Verb) GetPresentP2 ¶
func (*Verb) GetPresentP3 ¶
func (*Verb) GetPresentS1 ¶
func (*Verb) GetPresentS2 ¶
func (*Verb) GetPresentS3 ¶
func (*Verb) GetPreteriteP1 ¶
func (*Verb) GetPreteriteP2 ¶
func (*Verb) GetPreteriteP3 ¶
func (*Verb) GetPreteriteS1 ¶
func (*Verb) GetPreteriteS2 ¶
func (*Verb) GetPreteriteS3 ¶
func (*Verb) GetSeparated ¶
func (v *Verb) GetSeparated(pp PersonalPronoun, tense Tense) [][2]string
func (*Verb) GetVerbPresent ¶
func (v *Verb) GetVerbPresent(pp PersonalPronoun) []string
func (*Verb) GetVerbPreterite ¶
func (v *Verb) GetVerbPreterite(pp PersonalPronoun) []string
type Word ¶
type Word interface { GetId() bson.ObjectId SetId(bson.ObjectId) GetGerman() string GetEnglish() []Meaning GetThird() []Meaning GetCategory() string GetUser() string GetScore() int GetLearned() time.Time GetErrors() []string GetScores() []*general.Score AddScore(score *general.Score) NewScore(result int) }
Click to show internal directories.
Click to hide internal directories.