def transitionPossibleForWord(self, root: TxtWord,
                               fromState: State) -> bool:
     if root.isAdjective() and ((root.isNominal() and not root.isExceptional()) or root.isPronoun()) \
             and self.__toState.getName() == "NominalRoot(ADJ)" and self.__with == "0":
         return False
     if root.isAdjective() and root.isNominal() and self.__with == "^DB+VERB+ZERO+PRES+A3PL" \
             and fromState.getName() == "AdjectiveRoot":
         return False
     if root.isAdjective() and root.isNominal(
     ) and self.__with == "SH" and fromState.getName() == "AdjectiveRoot":
         return False
     if self.__with == "ki":
         return root.takesRelativeSuffixKi()
     if self.__with == "kü":
         return root.takesRelativeSuffixKu()
     if self.__with == "dHr":
         if self.__toState.getName() == "Adverb":
             return True
         else:
             return root.takesSuffixDIRAsFactitive()
     if self.__with == "Hr" and (
             self.__toState.getName() == "AdjectiveRoot(VERB)"
             or self.__toState.getName() == "OtherTense"
             or self.__toState.getName() == "OtherTense2"):
         return root.takesSuffixIRAsAorist()
     return True
예제 #2
0
    def softenDuringSuffixation(self, root: TxtWord) -> bool:
        """
        The startWithVowelorConsonantDrops method checks for some cases. If the first character of with variable is
        "nsy", and with variable does not equal to one of the Strings; "ylA, ysA, ymHs, yDH, yken", it returns true. If

        Or, if the first character of with variable is 'A, H: or any other vowels, it returns true.

        RETURNS
        -------
        bool
            True if it starts with vowel or consonant drops, false otherwise.
        """
        if (root.isNominal() or root.isAdjective()) and root.nounSoftenDuringSuffixation() and \
                (self.__with == "Hm" or self.__with == "nDAn" or self.__with == "ncA" or self.__with == "nDA"
                 or self.__with == "yA" or self.__with == "yHm" or self.__with == "yHz" or self.__with == "yH"
                 or self.__with == "nH" or self.__with == "nA" or self.__with == "nHn" or self.__with == "H"
                 or self.__with == "sH" or self.__with == "Hn" or self.__with == "HnHz" or self.__with == "HmHz"):
            return True
        if root.isVerb() and root.verbSoftenDuringSuffixation() and \
                (self.__with.startswith("Hyor") or self.__with == "yHs" or self.__with == "yAn" or self.__with == "yA"
                 or self.__with == "yAcAk" or self.__with == "yAsH" or self.__with == "yHncA" or self.__with == "yHp"
                 or self.__with == "yAlH" or self.__with == "yArAk" or self.__with == "yAdur" or self.__with == "yHver"
                 or self.__with == "yAgel" or self.__with == "yAgor" or self.__with == "yAbil" or self.__with == "yAyaz"
                 or self.__with == "yAkal" or self.__with == "yAkoy" or self.__with == "yAmA" or self.__with == "yHcH"
                 or self.__with == "yHs" or self.__with == "HCH" or self.__with == "Hr" or self.__with == "Hs"
                 or self.__with == "Hn" or self.__with == "yHn" or self.__with == "yHnHz" or self.__with == "Ar"
                 or self.__with == "Hl"):
            return True
        return False
 def softenDuringSuffixation(self, root: TxtWord) -> bool:
     if (root.isNominal() or root.isAdjective()) and root.nounSoftenDuringSuffixation() and \
             (self.__with == "Hm" or self.__with == "nDAn" or self.__with == "ncA" or self.__with == "nDA"
              or self.__with == "yA" or self.__with == "yHm" or self.__with == "yHz" or self.__with == "yH"
              or self.__with == "nH" or self.__with == "nA" or self.__with == "nHn" or self.__with == "H"
              or self.__with == "sH" or self.__with == "Hn" or self.__with == "HnHz" or self.__with == "HmHz"):
         return True
     if root.isVerb() and root.verbSoftenDuringSuffixation() and \
             (self.__with.startswith("Hyor") or self.__with == "yHs" or self.__with == "yAn" or self.__with == "yA"
              or self.__with == "yAcAk" or self.__with == "yAsH" or self.__with == "yHncA" or self.__with == "yHp"
              or self.__with == "yAlH" or self.__with == "yArAk" or self.__with == "yAdur" or self.__with == "yHver"
              or self.__with == "yAgel" or self.__with == "yAgor" or self.__with == "yAbil" or self.__with == "yAyaz"
              or self.__with == "yAkal" or self.__with == "yAkoy" or self.__with == "yAmA" or self.__with == "yHcH"
              or self.__with == "yHs" or self.__with == "HCH" or self.__with == "Hr" or self.__with == "Hs"
              or self.__with == "Hn" or self.__with == "yHn" or self.__with == "yHnHz" or self.__with == "Ar"
              or self.__with == "Hl"):
         return True
     return False