Package com.mathmaster13.fynotek
Class FynotekWord
java.lang.Object
com.mathmaster13.fynotek.BaseFynotekWord
com.mathmaster13.fynotek.FynotekWord
A class for handling words in Fynotek, a conlang by mochaspen. All objects created by this class are immutable. Fynotek documentarion can be found here.
- Since:
- 1.0
- Author:
- mathmaster13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents the case of a Fynotek noun.Nested classes/interfaces inherited from class com.mathmaster13.fynotek.BaseFynotekWord
BaseFynotekWord.Ablaut, BaseFynotekWord.Person, BaseFynotekWord.Tense -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull FynotekWordThe irregular word folo, in its completely unmarked (root) form.final booleanRepresents if this FynotekWord is a proper noun or not.static final @NotNull BigIntegerThe maximum integer supported by Fynotek's number system.Fields inherited from class com.mathmaster13.fynotek.BaseFynotekWord
beginning, end, inflection, vowels -
Constructor Summary
ConstructorsConstructorDescriptionFynotekWord(@NotNull String word) Converts a String to a FynotekWord.FynotekWord(@NotNull String word, boolean isProper) Converts a String and a boolean to a FynotekWord.FynotekWord(@NotNull String word, @Nullable Inflection inflection, boolean isProper) Converts a String to a FynotekWord, and marks the word as having the specified inflection. -
Method Summary
Modifier and TypeMethodDescription@NotNull FynotekWordablaut(@NotNull BaseFynotekWord.Ablaut ablaut) Returns a copy of this FynotekWord marked for the specified ablaut.booleanGenerated by IntelliJ IDEA Community.@Nullable BaseFynotekWord.AblautReturns theBaseFynotekWord.Ablautthat this word is marked with, ornullif it is completely unmarked (a root form).inthashCode()Generated by IntelliJ IDEA Community.@NotNull FynotekWordinflect(@Nullable Inflection inflection) Returns a copy of this word inflected for the inflection specified byinflection.static booleanisValidSequence(@NotNull String sequence) Returns whether the given sequence is phonotactically and orthographically valid in Fynotek.@NotNull FynotekWordmatch(@NotNull BaseFynotekWord word) Returns a copy of this word inflected for the same case or tense asword.@NotNull FynotekWordnounCase(@NotNull FynotekWord.Case caseOfNoun) Returns a copy of this FynotekWord inflected for the noun case specified bycaseOfNoun.static @NotNull Stringnumber(long num) Returns the Fynotek translation of the specified number.static @NotNull Stringnumber(@NotNull BigInteger num) Returns the Fynotek translation of the specified number.@NotNull FynotekWordpersonSuffix(@NotNull BaseFynotekWord.Person person) Returns a copy of this word with a suffix added to mark the first, second, or third person.@NotNull FynotekWordReturns a new FynotekWord with the specified prefix appended to the beginning of this word.@NotNull FynotekWordReturns a new FynotekWord with the specified suffix appended to the end of this word.@NotNull FynotekWordverbTense(@NotNull BaseFynotekWord.Tense tenseOfVerb) Returns a copy of this FynotekWord inflected for the verb tense (if this word is not a proper noun) or verb modifier form (if this word is a proper noun or the word folo) specified bytenseOfVerb.Methods inherited from class com.mathmaster13.fynotek.BaseFynotekWord
isMarked, separateVowels, toString
-
Field Details
-
isProper
public final boolean isProperRepresents if this FynotekWord is a proper noun or not.- See Also:
-
_ablaut(Ablaut)properSuffix(Ablaut)match(BaseFynotekWord)
-
FOLO
The irregular word folo, in its completely unmarked (root) form.- Since:
- 2.0
-
MAX_MAGNITUDE
The maximum integer supported by Fynotek's number system. You can compare if a numberxis too large or small with(x.abs().compareTo(MAX_MAGNITUDE) > 0).- See Also:
-
-
Constructor Details
-
FynotekWord
Converts a String and a boolean to a FynotekWord. The String contains the word itself, while the boolean represents whether the word is a proper noun:trueif it is, andfalseif it is not. Leading and trailing whitespace is ignored (theString.trim()method is called onword). This constructor assumes that a word is in its root form, with no inflection.- Parameters:
word- word to be converted to a FynotekWord.isProper-trueif this word is a proper noun, orfalseif it is not.
-
FynotekWord
Converts a String to a FynotekWord. The word is assumed not to be a proper noun. Leading and trailing whitespace is ignored (theString.trim()method is called onword). This constructor assumes that a word is in its root form, with no inflection.- Parameters:
word- word to be converted to a FynotekWord.
-
FynotekWord
public FynotekWord(@NotNull @NotNull String word, @Nullable @Nullable Inflection inflection, boolean isProper) Converts a String to a FynotekWord, and marks the word as having the specified inflection. Leading and trailing whitespace is ignored (theString.trim()method is called onword), and the word will always be converted to lowercase. This constructor should be used with words known at compile time, or with words known to be marked for the present tense or theOTHERcase (since those forms and root forms are identical as strings). For example, the accusative form of the word "hyr" is "hor", and would be created withnew FynotekWord("hor", Case.ACCUSATIVE, false). A root form (the abstract form of a word with no case or tense marking) is represented by anullinflection.- Parameters:
word- word to be converted to a FynotekWord.inflection- this word's inflection, ornullif it does not have one.isProper-trueif this word is a proper noun, orfalseif it is not.
-
-
Method Details
-
equals
Generated by IntelliJ IDEA Community.- Overrides:
equalsin classBaseFynotekWord
-
hashCode
public int hashCode()Generated by IntelliJ IDEA Community.- Overrides:
hashCodein classBaseFynotekWord
-
ablaut
Returns a copy of this FynotekWord marked for the specified ablaut. For proper nouns, a suffix is applied instead. If this function is used on a word, it is assumed that the word has been marked for case or tense, but the case or tense is unknown. This function should be called before any suffix functions, not after. If a word has previously been inflected, it usually should not be inflected again. If this function is called on a marked word, there is no guarantee for the result. Check for marking withBaseFynotekWord.isMarked().- Specified by:
ablautin classBaseFynotekWord- Parameters:
ablaut- the ablaut to mark this word as.- Returns:
- a copy of this FynotekWord marked for the specified ablaut.
- Since:
- 3.0
- See Also:
-
getAblaut
Description copied from class:BaseFynotekWordReturns theBaseFynotekWord.Ablautthat this word is marked with, ornullif it is completely unmarked (a root form).- Overrides:
getAblautin classBaseFynotekWord- Returns:
- the Ablaut that this word is marked with
- See Also:
-
nounCase
@NotNull public @NotNull FynotekWord nounCase(@NotNull @NotNull FynotekWord.Case caseOfNoun) throws IllegalArgumentException Returns a copy of this FynotekWord inflected for the noun case specified bycaseOfNoun. Note that the word "folo" as a common noun cannot be marked for the nominative case, and doing so throws anIllegalArgumentException. This method should be called before any suffix methods, not after. If a word has previously been marked for case or tense, it usually should not be marked again. If this method is called on a marked word, there is no guarantee for the result. Check for marking withBaseFynotekWord.isMarked().- Parameters:
caseOfNoun- the noun case to inflect this FynotekWord for.- Returns:
- this FynotekWord inflected for the specified noun case.
- Throws:
IllegalArgumentException- See Also:
-
verbTense
Returns a copy of this FynotekWord inflected for the verb tense (if this word is not a proper noun) or verb modifier form (if this word is a proper noun or the word folo) specified bytenseOfVerb. This method should be called before any suffix methods, not after. If a word has previously been marked for case or tense, it usually should not be marked again. If this method is called on a marked word, there is no guarantee for the result. Check for marking withBaseFynotekWord.isMarked().- Specified by:
verbTensein classBaseFynotekWord- Parameters:
tenseOfVerb- the verb tense to inflect this FynotekWord for.- Returns:
- this FynotekWord inflected for the specified verb tense.
- See Also:
-
suffix
Returns a new FynotekWord with the specified suffix appended to the end of this word. If the suffix creates a phonotactically invalid sequence, n or a will be infixed as needed to make the resulting word phonotactically valid. Leading and trailing whitespace is ignored (theString.trim()method is called onsuffix). This method applies a suffix, so no inflections should be called on a word after this method is called on it.- Parameters:
suffix- the suffix to be appended to the end of this FynotekWord- Returns:
- a FynotekWord with the specified suffix appended to the end of it.
- See Also:
-
prefix
Returns a new FynotekWord with the specified prefix appended to the beginning of this word. If the prefix creates a phonotactically invalid sequence, n or a will be infixed as needed to make the resulting word phonotactically valid. Leading and trailing whitespace is ignored (theString.trim()method is called onprefix).- Parameters:
prefix- the prefix to be appended to the beginning of this FynotekWord.- Returns:
- a FynotekWord with the specified prefix appended to the beginning of it.
- See Also:
-
inflect
Description copied from class:BaseFynotekWordReturns a copy of this word inflected for the inflection specified byinflection. This function should be called before any suffix functions, not after. If a word has previously been inflected, it usually should not be inflected again. If this function is called on a marked word, there is no guarantee for the result. Check for marking withBaseFynotekWord.isMarked().- Overrides:
inflectin classBaseFynotekWord- Parameters:
inflection- the inflection to inflect this BaseFynotekWord for.- Returns:
- this BaseFynotekWord inflected for the specified inflection.
- See Also:
-
match
Returns a copy of this word inflected for the same case or tense asword. This function callsinflect(word.inflection). This function should be called before any suffix functions, not after. If a word has previously been marked for case or tense, it usually should not be marked again. If this function is called on a marked word, there is no guarantee for the result.- Overrides:
matchin classBaseFynotekWord- Parameters:
word- the BaseFynotekWord to match this word's inflection with.- Returns:
- this word inflected for the same case or tense as
word. - See Also:
-
personSuffix
Description copied from class:BaseFynotekWordReturns a copy of this word with a suffix added to mark the first, second, or third person. This method applies a suffix, so no inflections should be called on a word after this method is called on it.- Specified by:
personSuffixin classBaseFynotekWord- Parameters:
person- the person to mark this word for.- Returns:
- this word with a suffix added to mark the first, second, or third person.
- See Also:
-
number
Returns the Fynotek translation of the specified number. If the number's absolute value is greater thanMAX_MAGNITUDE, an empty String is returned.- Parameters:
num- the number to be translated.- Returns:
- the Fynotek translation of the specified number.
- Throws:
IllegalArgumentException- If the number provided is too large for the number system to handle.- See Also:
-
number
Returns the Fynotek translation of the specified number.- Parameters:
num- the number to be translated.- Returns:
- the Fynotek translation of the specified number.
-
isValidSequence
Returns whether the given sequence is phonotactically and orthographically valid in Fynotek. Capitalization is ignored (for example,"A"and"a"are treated the same way). Multiple words can be separated by whitespace, and this method will only returntrueif all words insequenceare valid. Leading and trailing whitespace is ignored (theString.trim()method is called onsequence). A sequence containing punctuation marks, numbers, or other non-letter characters returnsfalse, as well as an empty sequence or one containing only whitespace. Note that despite that "annnnn" (with any number of Ns) is used in Fynotek, it is not considered a valid sequence because it breaks phonotactics (so only "an" and "ann" are valid sequences when used with this function).- Parameters:
sequence- the sequence to be checked for validity.- Returns:
trueifsequenceis a valid sequence, andfalseif otherwise.
-