sueno

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package sueno provides utilities for building sueno words.

Index

Constants

View Source
const (
	DefiniteArticle   = "o"
	IndefiniteArticle = "a"
)

Variables

This section is empty.

Functions

func IsAdjective

func IsAdjective(word string) bool

IsAdjective returns true if the given word could be grammatically an adjective, according to its suffix.

func IsAdverb

func IsAdverb(word string) bool

IsAdverb returns true if the given word could be grammatically an adverb, according to its suffix.

func IsArticle

func IsArticle(word string) bool

IsArticle returns true if the given word is an article.

func IsBaseAdjective added in v0.1.0

func IsBaseAdjective(word string) bool

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

func IsBaseAdverb(word string) bool

IsBaseAdverb returns true if the given word could be grammatically an adverb in its base form, according to its suffix.

func IsCardinal

func IsCardinal(word string) bool

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

func IsComparativeAdjective(word string) bool

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

func IsComparativeAdverb(word string) bool

IsComparativeAdverb returns true if the given word could be grammatically an adverb in its comparative form, according to its suffix.

func IsConditionalMood

func IsConditionalMood(word string) bool

IsConditionalMood returns true if the given word is in the conditional mood.

func IsConsonant added in v0.1.0

func IsConsonant(r rune) bool

func IsFraction added in v0.3.0

func IsFraction(word string) bool

IsFraction reports whether the given word represents a fraction.

func IsFuture

func IsFuture(word string) bool

IsFuture returns true if the given word is in the future tense.

The word may be in any grammatical mood.

func IsFutureParticiple

func IsFutureParticiple(word string) bool

func IsGeneralizingPronoun

func IsGeneralizingPronoun(word string) bool

IsGeneralizingPronoun returns true if the given word is the generalizing pronoun 'vi'.

func IsImperativeMood

func IsImperativeMood(word string) bool

func IsIndicativeMood

func IsIndicativeMood(word string) bool

IsIndicativeMood returns true if the given word is in the indicative mood in any tense.

func IsInfinitiveMood

func IsInfinitiveMood(word string) bool

IsInfinitiveMood returns true if the given word is a verb in its infinitive mood.

func IsNoun

func IsNoun(word string) bool

IsNoun returns true if the given word could be grammatically a noun.

func IsOrdinal

func IsOrdinal(word string) bool

func IsParticiple

func IsParticiple(word string) bool

func IsPast

func IsPast(word string) bool

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 IsPastParticiple(word string) bool

func IsPersonalPronoun

func IsPersonalPronoun(word string) bool

IsPersonalPronoun returns true if the given word is one of the personal pronouns.

func IsPlural

func IsPlural(word string) bool

IsPlural returns true if the given noun is plural.

func IsPossessivePronoun

func IsPossessivePronoun(word string) bool

IsPossessivePronoun returns true if the given word is one of the possessive pronouns.

func IsPresent

func IsPresent(word string) bool

IsPresent returns true if the given word is in the present tense.

The word may be in any grammatical mood.

func IsPresentParticiple

func IsPresentParticiple(word string) bool

func IsPronoun

func IsPronoun(word string) bool

IsPronoun returns true if the given word is a personal, possessive, or generalizing pronoun.

func IsSingular

func IsSingular(word string) bool

IsSingular returns true if the given noun is singular.

func IsSubjunctiveMood

func IsSubjunctiveMood(word string) bool

func IsSuperlative added in v0.1.0

func IsSuperlative(word string) bool

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

func IsSuperlativeAdverb(word string) bool

IsSuperlativeAdverb returns true if the given word could be grammatically an adverb in its superlative form, according to its suffix.

func IsVerb

func IsVerb(word string) bool

IsVerb returns true if the given word is a verb in any conjugated form.

func IsVowel added in v0.1.0

func IsVowel(r rune) bool

func RootOf

func RootOf(word string) string

func ToBaseAdjective added in v0.1.0

func ToBaseAdjective(word string) string

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

func ToBaseAdverb(word string) string

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

func ToCardinal(word string) string

ToCardinal converts the given ordinal to its cardinal form.

word must be a valid ordinal or denominator.

func ToComparativeAdjective added in v0.1.0

func ToComparativeAdjective(word string) string

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

func ToComparativeAdverb(word string) string

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

func ToFraction(word string) string

ToFraction converts the given cardinal to its fraction form.

word must be a valid cardinal or ordinal.

func ToFutureConditional

func ToFutureConditional(word string) string

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

func ToFutureIndicative(word string) string

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

func ToFutureParticiple(word string) string

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

func ToFutureSubjunctive(word string) string

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

func ToImperative(word string) string

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

func ToInfinitive(word string) string

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

func ToOrdinal(word string) string

ToOrdinal converts the given cardinal to its ordinal form.

word must be a valid cardinal or fraction.

func ToPastConditional

func ToPastConditional(word string) string

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

func ToPastIndicative(word string) string

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

func ToPastParticiple(word string) string

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

func ToPastSubjunctive(word string) string

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

func ToPluralNoun(word string) string

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

func ToPresentConditional(word string) string

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

func ToPresentIndicative(word string) string

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

func ToPresentParticiple(word string) string

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

func ToPresentSubjunctive(word string) string

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

func ToSingularNoun(word string) string

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

func ToSuperlativeAdjective(word string) string

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

func ToSuperlativeAdverb(word string) string

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
const (
	InvalidWordType WordType = iota
	Noun
	Verb
	Participle
	Adjective
	Adverb
	Preposition
	Conjunction
	Interjection
	Pronoun
	Article
	Cardinal
	Ordinal
	Abbreviation
	Idiom
	Other
)

func Type

func Type(word string) WordType

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.

Jump to

Keyboard shortcuts

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