Class OldFynotekWord

java.lang.Object
com.mathmaster13.fynotek.BaseFynotekWord
com.mathmaster13.fynotek.OldFynotekWord

public final class OldFynotekWord extends BaseFynotekWord
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
  • Constructor Details

    • OldFynotekWord

      public OldFynotekWord(@NotNull @NotNull String word)
      Converts a String to an OldFynotekWord. Leading and trailing whitespace is ignored (the String.trim() method is called on word). This constructor assumes that a word is in its root form, with no inflection.
      Parameters:
      word - word to be converted to an OldFynotekWord.
    • OldFynotekWord

      public OldFynotekWord(@NotNull @NotNull String word, @NotNull @NotNull Inflection inflection)
      Converts a String to an OldFynotekWord, and marks the word as having the specified inflection. Leading and trailing whitespace is ignored (the String.trim() method is called on word), 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 with new OldFynotekWord("no", Tense.FUTURE). A root form (the abstract form of a word with no case or tense marking) is represented by a null inflection. While this constructor does not forbid you from using an instance of FynotekWord.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, or null 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. If Ablaut.Y is entered as the ablaut to mark the word as, an IllegalArgumentException 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 with BaseFynotekWord.isMarked().
      Specified by:
      ablaut in class BaseFynotekWord
      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

      @Nullable public @Nullable BaseFynotekWord.Ablaut getAblaut()
      Returns the BaseFynotekWord.Ablaut that this word is marked with, or null if it is completely unmarked (a root form). If this word was inflected with a noun case through the match(BaseFynotekWord) method, BaseFynotekWord.Ablaut.DEFAULT is returned.
      Overrides:
      getAblaut in class BaseFynotekWord
      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 by tenseOfVerb. 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 with BaseFynotekWord.isMarked(). Old Fynotek makes no distinction between hypothetical and non-hypothetical gnomic, so BaseFynotekWord.Tense.HYP_GNOMIC and BaseFynotekWord.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 in GNOMIC to ensure proper behavior of BaseFynotekWord.equals(java.lang.Object).
      Specified by:
      verbTense in class BaseFynotekWord
      Parameters:
      tenseOfVerb - the verb tense to inflect this BaseFynotekWord for.
      Returns:
      this BaseFynotekWord inflected for the specified verb tense.
      See Also:
    • inflect

      @NotNull public @NotNull OldFynotekWord inflect(@Nullable @Nullable Inflection inflection)
      Returns a copy of this word inflected for the inflection specified by inflection. 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 with BaseFynotekWord.isMarked(). If inflection is an instance of FynotekWord.Case, the result is returned with the supplied noun case as its inflection, but with BaseFynotekWord.Ablaut.DEFAULT ablaut applied.
      Overrides:
      inflect in class BaseFynotekWord
      Parameters:
      inflection - the inflection to inflect this BaseFynotekWord for.
      Returns:
      this BaseFynotekWord inflected for the specified inflection.
      Since:
      3.0
      See Also:
    • match

      @NotNull public @NotNull OldFynotekWord match(@NotNull @NotNull BaseFynotekWord word)
      Returns a copy of this word inflected for the same case or tense as word. This function calls inflect(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 a FynotekWord marked for a noun case, this word is returned with the FynotekWord's inflection, but with BaseFynotekWord.Ablaut.DEFAULT ablaut applied.
      Overrides:
      match in class BaseFynotekWord
      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 class BaseFynotekWord
      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

      public static boolean isValidSequence(@NotNull @NotNull String sequence)
      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 return true if all words in sequence are valid. Leading and trailing whitespace is ignored (the String.trim() method is called on sequence). A sequence containing punctuation marks, numbers, or other non-letter characters (with the exception of ') returns false, as well as an empty sequence or one containing only whitespace.
      Parameters:
      sequence - the sequence to be checked for validity.
      Returns:
      true if sequence is a valid sequence, and false if otherwise.