Пример #1
0
    def addSuffix(self, suffix: State, form: str, transition: str,
                  withName: str, toPos: str):
        """
        The addSuffix method takes 5 different inputs; State suffix, str form, transition, with and toPos.
        If the pos of given input suffix is not None, it then assigns it to the pos variable. If the pos of the given
        suffix is None but given toPos is not None than it assigns toPos to pos variable. At the end, it adds suffix to
        the suffixList, form to the formList, transition to the transitionList and if given with is not 0, it is also
        added to withList.

        PARAMETERS
        ----------
        suffix : State
            State input.
        form : str
            String input.
        transition : str
            String input.
        withName : str
            String input.
        toPos : str
            String input.
        """
        if suffix.getPos() is not None:
            self.__pos = suffix.getPos()
        else:
            if toPos is not None:
                self.__pos = toPos
        self.__suffixList.append(suffix)
        self.__formList.append(form)
        self.__transitionList.append(transition)
        if withName != "0":
            self.__withList.append(withName)
        self.__form = form
Пример #2
0
 def addSuffix(self, suffix: State, form: str, transition: str,
               withName: str, toPos: str):
     if suffix.getPos() is not None:
         self.__pos = suffix.getPos()
     else:
         if toPos is not None:
             self.__pos = toPos
     self.__suffixList.append(suffix)
     self.__formList.append(form)
     self.__transitionList.append(transition)
     if withName != "0":
         self.__withList.append(withName)
     self.__form = form