Package com.mathmaster13.fynotek
Class BaseFynotekWord
java.lang.Object
com.mathmaster13.fynotek.BaseFynotekWord
- Direct Known Subclasses:
FynotekWord,OldFynotekWord
A class for handling words in Fynotek, a conlang by mochaspen, in both its modern and old form.
The parent class of
FynotekWord and OldFynotekWord, containing all shared code between the two.
All instances of this class' subclasses are immutable.
All subclasses of this class allow words to be instantiated that are not phonotactically or orthographically valid in Fynotek,
due to names, loanwords, and other reasons. However, these classes strictly adhere to the phonotactics and orthography of Fynotek.
As such, each class provides a static isValidSequence method to check the validity of a word if desired.- Since:
- 1.0
- Author:
- mathmaster13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRepresents Fynotek ablaut.static enumRepresents the concept of person on a Fynotek verb.static enumRepresents the tense of a Fynotek verb. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @NotNull StringThe part of a Fynotek word before its final vowel or diphthong.final @NotNull StringThe part of a Fynotek word after its final vowel or diphthong.final @Nullable InflectionRepresents the case or tense that this word is marked with.final @NotNull StringA Fynotek word's final vowel or diphthong. -
Constructor Summary
ConstructorsConstructorDescriptionBaseFynotekWord(@NotNull String word) Converts a String to a BaseFynotekWord.BaseFynotekWord(@NotNull String word, @Nullable Inflection inflection) Converts a String to a BaseFynotekWord, and marks the word as having the specified inflection. -
Method Summary
Modifier and TypeMethodDescriptionabstract @NotNull BaseFynotekWordablaut(@NotNull BaseFynotekWord.Ablaut ablaut) Returns a copy of this BaseFynotekWord marked for the specified ablaut.booleanChecks strict value-based equality of this word and an Object.@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 BaseFynotekWordinflect(@Nullable Inflection inflection) Returns a copy of this word inflected for the inflection specified byinflection.final booleanisMarked()Returns whether this BaseFynotekWord is marked or not.@NotNull BaseFynotekWordmatch(@NotNull BaseFynotekWord word) Returns a copy of this word inflected for the same case or tense asword.abstract @NotNull BaseFynotekWordpersonSuffix(@NotNull BaseFynotekWord.Person person) Returns a copy of this word with a suffix added to mark the first, second, or third person.static @NotNull String[]separateVowels(@NotNull String word) Returns an array of 3 Strings: the first containing the part ofwordbefore its final vowel or diphthong, the second containing its final vowel or diphthong, and the third containing the part after its final vowel or diphthong.@NotNull StringtoString()Returns a String representation of this word.abstract @NotNull BaseFynotekWordverbTense(@NotNull BaseFynotekWord.Tense tense) Returns a copy of this word inflected for the verb tense specified bytenseOfVerb.
-
Field Details
-
beginning
The part of a Fynotek word before its final vowel or diphthong.- See Also:
-
vowels
A Fynotek word's final vowel or diphthong.- See Also:
-
BaseFynotekWord(String)_ablaut(Ablaut)
-
end
The part of a Fynotek word after its final vowel or diphthong.- See Also:
-
inflection
Represents the case or tense that this word is marked with. Anullvalue represents a word's root form. Note that a root form is not the same as a word marked for the present tense—seeInflectionfor details.- Since:
- 2.0
- See Also:
-
-
Constructor Details
-
BaseFynotekWord
Converts a String to a BaseFynotekWord. Leading and trailing whitespace is ignored (theString.trim()method is called onword), and the word will always be converted to lowercase. This constructor assumes that a word is in its root form, with no inflection.- Parameters:
word- word to be converted to a BaseFynotekWord.
-
BaseFynotekWord
Converts a String to a BaseFynotekWord, 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 (since the present-tense form and the root form are identical as strings). 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 BaseFynotekWord.inflection- this word's inflection, ornullif it does not have one.- See Also:
-
-
Method Details
-
toString
Returns a String representation of this word. -
equals
Checks strict value-based equality of this word and an Object. If two words have the same string representation but different inflections, they will not be considered equal. For example, the word "tau" marked in both the hypothetical future and hypothetical gnomic tenses is "tuu", but since those two words are marked with different tenses, they are not considered equal. Generated by IntellIJ IDEA Community. -
hashCode
public int hashCode()Generated by IntellIJ IDEA Community. -
ablaut
@NotNull public abstract @NotNull BaseFynotekWord ablaut(@NotNull @NotNull BaseFynotekWord.Ablaut ablaut) Returns a copy of this BaseFynotekWord marked for the specified ablaut. 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 withisMarked().- Parameters:
ablaut- the ablaut to mark this word as.- Returns:
- a copy of this BaseFynotekWord marked for the specified ablaut.
- Since:
- 3.0
- See Also:
-
separateVowels
Returns an array of 3 Strings: the first containing the part ofwordbefore its final vowel or diphthong, the second containing its final vowel or diphthong, and the third containing the part after its final vowel or diphthong. Leading and trailing whitespace is ignored (theString.trim()method is called onword), and the word will always be converted to lowercase. If a word has no vowels (as defined byisVowel(char)), the word is placed as the third string.- Parameters:
word- the word to be parsed for final vowels- Returns:
- an array containing
wordseparated by its final vowel or diphthong. - Since:
- 3.0
-
getAblaut
Returns theBaseFynotekWord.Ablautthat this word is marked with, ornullif it is completely unmarked (a root form).- Returns:
- the Ablaut that this word is marked with
- Since:
- 2.0
- See Also:
-
verbTense
@NotNull public abstract @NotNull BaseFynotekWord verbTense(@NotNull @NotNull BaseFynotekWord.Tense tense) Returns a copy of this word inflected for the verb tense specified bytenseOfVerb. 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. Check for marking withisMarked().- Parameters:
tense- the verb tense to inflect this BaseFynotekWord for.- Returns:
- this BaseFynotekWord inflected for the specified verb tense.
- See Also:
-
inflect
Returns 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 withisMarked().- Parameters:
inflection- the inflection to inflect this BaseFynotekWord for.- Returns:
- this BaseFynotekWord inflected for the specified inflection.
- Since:
- 3.0
- 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.- 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:
-
isMarked
public final boolean isMarked()Returns whether this BaseFynotekWord is marked or not. Specifically, returnsinflection != null.- Returns:
trueif this BaseFynotekWord has been marked by ablaut or a proper noun suffix, andfalseif it has not been.- See Also:
-
personSuffix
@NotNull public abstract @NotNull BaseFynotekWord personSuffix(@NotNull @NotNull BaseFynotekWord.Person person) Returns 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.- 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:
-