Documentation
¶
Overview ¶
Package sueno provides utilities for building sueno words.
Index ¶
- Constants
- func IsAdjective(word string) bool
- func IsAdverb(word string) bool
- func IsArticle(word string) bool
- func IsBaseAdjective(word string) bool
- func IsBaseAdverb(word string) bool
- func IsCardinal(word string) bool
- func IsComparativeAdjective(word string) bool
- func IsComparativeAdverb(word string) bool
- func IsConditionalMood(word string) bool
- func IsConsonant(r rune) bool
- func IsFraction(word string) bool
- func IsFuture(word string) bool
- func IsFutureParticiple(word string) bool
- func IsGeneralizingPronoun(word string) bool
- func IsImperativeMood(word string) bool
- func IsIndicativeMood(word string) bool
- func IsInfinitiveMood(word string) bool
- func IsNoun(word string) bool
- func IsOrdinal(word string) bool
- func IsParticiple(word string) bool
- func IsPast(word string) bool
- func IsPastParticiple(word string) bool
- func IsPersonalPronoun(word string) bool
- func IsPlural(word string) bool
- func IsPossessivePronoun(word string) bool
- func IsPresent(word string) bool
- func IsPresentParticiple(word string) bool
- func IsPronoun(word string) bool
- func IsSingular(word string) bool
- func IsSubjunctiveMood(word string) bool
- func IsSuperlative(word string) bool
- func IsSuperlativeAdverb(word string) bool
- func IsVerb(word string) bool
- func IsVowel(r rune) bool
- func RootOf(word string) string
- func ToBaseAdjective(word string) string
- func ToBaseAdverb(word string) string
- func ToCardinal(word string) string
- func ToComparativeAdjective(word string) string
- func ToComparativeAdverb(word string) string
- func ToFraction(word string) string
- func ToFutureConditional(word string) string
- func ToFutureIndicative(word string) string
- func ToFutureParticiple(word string) string
- func ToFutureSubjunctive(word string) string
- func ToImperative(word string) string
- func ToInfinitive(word string) string
- func ToOrdinal(word string) string
- func ToPastConditional(word string) string
- func ToPastIndicative(word string) string
- func ToPastParticiple(word string) string
- func ToPastSubjunctive(word string) string
- func ToPluralNoun(word string) string
- func ToPresentConditional(word string) string
- func ToPresentIndicative(word string) string
- func ToPresentParticiple(word string) string
- func ToPresentSubjunctive(word string) string
- func ToSingularNoun(word string) string
- func ToSuperlativeAdjective(word string) string
- func ToSuperlativeAdverb(word string) string
- type WordType
Constants ¶
const ( DefiniteArticle = "o" IndefiniteArticle = "a" )
Variables ¶
This section is empty.
Functions ¶
func IsAdjective ¶
IsAdjective returns true if the given word could be grammatically an adjective, according to its suffix.
func IsAdverb ¶
IsAdverb returns true if the given word could be grammatically an adverb, according to its suffix.
func IsBaseAdjective ¶ added in v0.1.0
IsBaseAdjective returns true if the given word could be grammatically an adjective in its base form, according to its suffix.
func IsBaseAdverb ¶ added in v0.1.0
IsBaseAdverb returns true if the given word could be grammatically an adverb in its base form, according to its suffix.
func IsCardinal ¶
IsCardinal reports whether the given word represents a cardinal.
Multiple words will always yield false, even if they together still form a number.
func IsComparativeAdjective ¶ added in v0.1.0
IsComparativeAdjective returns true if the given word could be grammatically an adjective in its comparative form, according to its suffix.
func IsComparativeAdverb ¶ added in v0.1.0
IsComparativeAdverb returns true if the given word could be grammatically an adverb in its comparative form, according to its suffix.
func IsConditionalMood ¶
IsConditionalMood returns true if the given word is in the conditional mood.
func IsConsonant ¶ added in v0.1.0
func IsFraction ¶ added in v0.3.0
IsFraction reports whether the given word represents a fraction.
func IsFuture ¶
IsFuture returns true if the given word is in the future tense.
The word may be in any grammatical mood.
func IsFutureParticiple ¶
func IsGeneralizingPronoun ¶
IsGeneralizingPronoun returns true if the given word is the generalizing pronoun 'vi'.
func IsImperativeMood ¶
func IsIndicativeMood ¶
IsIndicativeMood returns true if the given word is in the indicative mood in any tense.
func IsInfinitiveMood ¶
IsInfinitiveMood returns true if the given word is a verb in its infinitive mood.
func IsParticiple ¶
func IsPast ¶
IsPast returns true if the given word is in the past tense in any mood.
The word may be in any grammatical mood.
func IsPastParticiple ¶
func IsPersonalPronoun ¶
IsPersonalPronoun returns true if the given word is one of the personal pronouns.
func IsPossessivePronoun ¶
IsPossessivePronoun returns true if the given word is one of the possessive pronouns.
func IsPresent ¶
IsPresent returns true if the given word is in the present tense.
The word may be in any grammatical mood.
func IsPresentParticiple ¶
func IsPronoun ¶
IsPronoun returns true if the given word is a personal, possessive, or generalizing pronoun.
func IsSingular ¶
IsSingular returns true if the given noun is singular.
func IsSubjunctiveMood ¶
func IsSuperlative ¶ added in v0.1.0
IsSuperlative returns true if the given word could be grammatically an adjective in its superlative form, according to its suffix.
func IsSuperlativeAdverb ¶ added in v0.1.0
IsSuperlativeAdverb returns true if the given word could be grammatically an adverb in its superlative form, according to its suffix.
func ToBaseAdjective ¶ added in v0.1.0
ToBaseAdjective returns the base adjective form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToBaseAdverb ¶ added in v0.1.0
ToBaseAdverb returns the base adverb form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToCardinal ¶
ToCardinal converts the given ordinal to its cardinal form.
word must be a valid ordinal or denominator.
func ToComparativeAdjective ¶ added in v0.1.0
ToComparativeAdjective returns the comparative adjective form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToComparativeAdverb ¶ added in v0.1.0
ToComparativeAdverb returns the comparative adverb form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToFraction ¶ added in v0.3.0
ToFraction converts the given cardinal to its fraction form.
word must be a valid cardinal or ordinal.
func ToFutureConditional ¶
ToFutureConditional returns the future conditional form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToFutureIndicative ¶ added in v0.1.0
ToFutureIndicative returns the future indicative form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToFutureParticiple ¶
ToFutureParticiple returns the future participle form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToFutureSubjunctive ¶
ToFutureSubjunctive returns the future subjunctive form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToImperative ¶
ToImperative returns the imperative form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToInfinitive ¶
ToInfinitive returns the infinitive form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToOrdinal ¶
ToOrdinal converts the given cardinal to its ordinal form.
word must be a valid cardinal or fraction.
func ToPastConditional ¶
ToPastConditional returns the past conditional form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPastIndicative ¶ added in v0.1.0
ToPastIndicative returns the past indicative form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPastParticiple ¶
ToPastParticiple returns the past participle form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPastSubjunctive ¶
ToPastSubjunctive returns the past subjunctive form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPluralNoun ¶
ToPluralNoun returns the plural noun form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPresentConditional ¶
ToPresentConditional returns the present conditional form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPresentIndicative ¶ added in v0.1.0
ToPresentIndicative returns the present indicative form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPresentParticiple ¶
ToPresentParticiple returns the present participle form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToPresentSubjunctive ¶
ToPresentSubjunctive returns the present subjunctive form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToSingularNoun ¶
ToSingularNoun returns the singular noun form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToSuperlativeAdjective ¶ added in v0.1.0
ToSuperlativeAdjective returns the superlative adjective form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
func ToSuperlativeAdverb ¶ added in v0.1.0
ToSuperlativeAdverb returns the superlative adverb form of the given word.
The word may be a noun, a verb, a participle, an adjective, or a constructed adverb.
If the root of the word cannot be extracted, an empty string is returned.
Note that the returned word is grammatically valid, but may not exist as a word in the language.
Types ¶
type WordType ¶
type WordType uint8
func Type ¶
Type attempts to derive the type of the given word by matching it against all pronouns, articles, and numerals.
If it does not match any of these, it attempts to infer the type of the word by analyzing its ending according to the grammar rules.
Note that this solely indicates that the word could be of the returned type, however, it is also possible that the word is a base word that could theoretically be of the returned type because of its ending.
If it succeeds, it returns the type. Otherwise, it returns InvalidWordType.