Package com.mathmaster13.fynotek
Class OldFynotekWord
java.lang.Object
com.mathmaster13.fynotek.BaseFynotekWord
com.mathmaster13.fynotek.OldFynotekWord
A class for handling words in an older version of Fynotek. All objects created by this class are immutable. Old Fynotek documentation can be found here.
- Since:
- 1.0
- Author:
- mathmaster13
-
Nested Class Summary
Nested classes/interfaces inherited from class com.mathmaster13.fynotek.BaseFynotekWord
BaseFynotekWord.Ablaut, BaseFynotekWord.Person, BaseFynotekWord.Tense -
Field Summary
Fields inherited from class com.mathmaster13.fynotek.BaseFynotekWord
beginning, end, inflection, vowels -
Constructor Summary
ConstructorsConstructorDescriptionOldFynotekWord(@NotNull String word) Converts a String to an OldFynotekWord.OldFynotekWord(@NotNull String word, @NotNull Inflection inflection) Converts a String to an OldFynotekWord, and marks the word as having the specified inflection. -
Method Summary
Modifier and TypeMethodDescription@NotNull OldFynotekWordablaut(@NotNull BaseFynotekWord.Ablaut ablaut) Returns a copy of this OldFynotekWord marked for the specified ablaut.@Nullable BaseFynotekWord.AblautReturns theBaseFynotekWord.Ablautthat this word is marked with, ornullif it is completely unmarked (a root form).@NotNull OldFynotekWordinflect(@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 old Fynotek.@NotNull OldFynotekWordmatch(@NotNull BaseFynotekWord word) Returns a copy of this word inflected for the same case or tense asword.@NotNull OldFynotekWordpersonSuffix(@NotNull BaseFynotekWord.Person person) Returns a copy of this word with a suffix added to mark the first, second, or third person.@NotNull OldFynotekWordverbTense(@NotNull BaseFynotekWord.Tense tenseOfVerb) Returns a copy of this word inflected for the verb tense specified bytenseOfVerb.Methods inherited from class com.mathmaster13.fynotek.BaseFynotekWord
equals, hashCode, isMarked, separateVowels, toString
-
Constructor Details
-
OldFynotekWord
Converts a String to an OldFynotekWord. 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 an OldFynotekWord.
-
OldFynotekWord
Converts a String to an OldFynotekWord, 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). For example, the future-tense form of the word "ni" is "no", and would be created withnew OldFynotekWord("no", Tense.FUTURE). A root form (the abstract form of a word with no case or tense marking) is represented by anullinflection. While this constructor does not forbid you from using an instance ofFynotekWord.Caseas an inflection, this is not extremely useful, since Old Fynotek does not mark for case.- Parameters:
word- word to be converted to an OldFynotekWord.inflection- this word's inflection, ornullif it does not have one.
-
-
Method Details
-
ablaut
@NotNull public @NotNull OldFynotekWord ablaut(@NotNull @NotNull BaseFynotekWord.Ablaut ablaut) throws IllegalArgumentException Returns a copy of this OldFynotekWord marked for the specified ablaut. IfAblaut.Yis entered as the ablaut to mark the word as, anIllegalArgumentExceptionwill be thrown, since there is no defined Y ablaut in Old Fynotek. 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. Since Old Fynotek has no case-marking, this function's only use is when doing interoperation with modern Fynotek words. 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 OldFynotekWord marked for the specified ablaut.
- Throws:
IllegalArgumentException- Since:
- 3.0
- See Also:
-
getAblaut
Returns theBaseFynotekWord.Ablautthat this word is marked with, ornullif it is completely unmarked (a root form). If this word was inflected with a noun case through thematch(BaseFynotekWord)method,BaseFynotekWord.Ablaut.DEFAULTis returned.- Overrides:
getAblautin classBaseFynotekWord- Returns:
- the Ablaut that this word is marked with
- Since:
- 2.0
- See Also:
-
verbTense
@NotNull public @NotNull OldFynotekWord verbTense(@NotNull @NotNull BaseFynotekWord.Tense tenseOfVerb) 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 withBaseFynotekWord.isMarked(). Old Fynotek makes no distinction between hypothetical and non-hypothetical gnomic, soBaseFynotekWord.Tense.HYP_GNOMICandBaseFynotekWord.Tense.GNOMIChave the same behavior in this method. However, the distinction is still made for interoperability with words from modern Fynotek. If you do not have old and modern words interoperating, always pass inGNOMICto ensure proper behavior ofBaseFynotekWord.equals(java.lang.Object).- Specified by:
verbTensein classBaseFynotekWord- Parameters:
tenseOfVerb- 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 withBaseFynotekWord.isMarked(). Ifinflectionis an instance ofFynotekWord.Case, the result is returned with the supplied noun case as its inflection, but withBaseFynotekWord.Ablaut.DEFAULTablaut applied.- Overrides:
inflectin classBaseFynotekWord- 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. If the word to be matched with is aFynotekWordmarked for a noun case, this word is returned with the FynotekWord's inflection, but withBaseFynotekWord.Ablaut.DEFAULTablaut applied.- 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
@NotNull public @NotNull OldFynotekWord personSuffix(@NotNull @NotNull BaseFynotekWord.Person person) 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:
-
isValidSequence
Returns whether the given sequence is phonotactically and orthographically valid in old 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 (with the exception of') returnsfalse, as well as an empty sequence or one containing only whitespace.- Parameters:
sequence- the sequence to be checked for validity.- Returns:
trueifsequenceis a valid sequence, andfalseif otherwise.
-