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
ConstructorDescriptionOldFynotekWord
(@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 OldFynotekWord
ablaut
(@NotNull BaseFynotekWord.Ablaut ablaut) Returns a copy of this OldFynotekWord marked for the specified ablaut.@Nullable BaseFynotekWord.Ablaut
Returns theBaseFynotekWord.Ablaut
that this word is marked with, ornull
if it is completely unmarked (a root form).@NotNull OldFynotekWord
inflect
(@Nullable Inflection inflection) Returns a copy of this word inflected for the inflection specified byinflection
.static boolean
isValidSequence
(@NotNull String sequence) Returns whether the given sequence is phonotactically and orthographically valid in old Fynotek.@NotNull OldFynotekWord
match
(@NotNull BaseFynotekWord word) Returns a copy of this word inflected for the same case or tense asword
.@NotNull OldFynotekWord
personSuffix
(@NotNull BaseFynotekWord.Person person) Returns a copy of this word with a suffix added to mark the first, second, or third person.@NotNull OldFynotekWord
verbTense
(@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 anull
inflection. While this constructor does not forbid you from using an instance ofFynotekWord.Case
as 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, ornull
if 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.Y
is entered as the ablaut to mark the word as, anIllegalArgumentException
will 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:
ablaut
in 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.Ablaut
that this word is marked with, ornull
if it is completely unmarked (a root form). If this word was inflected with a noun case through thematch(BaseFynotekWord)
method,BaseFynotekWord.Ablaut.DEFAULT
is returned.- Overrides:
getAblaut
in 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_GNOMIC
andBaseFynotekWord.Tense.GNOMIC
have 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 inGNOMIC
to ensure proper behavior ofBaseFynotekWord.equals(java.lang.Object)
.- Specified by:
verbTense
in 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()
. Ifinflection
is an instance ofFynotekWord.Case
, the result is returned with the supplied noun case as its inflection, but withBaseFynotekWord.Ablaut.DEFAULT
ablaut applied.- Overrides:
inflect
in 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 aFynotekWord
marked for a noun case, this word is returned with the FynotekWord's inflection, but withBaseFynotekWord.Ablaut.DEFAULT
ablaut applied.- Overrides:
match
in 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:BaseFynotekWord
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.- Specified by:
personSuffix
in 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 returntrue
if all words insequence
are 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:
true
ifsequence
is a valid sequence, andfalse
if otherwise.
-