def add(self, flex): """ Add all the inflection options to the data structure. As we propose that some dots missing, all the options of dot positions should be added. """ patterns = [u'%s', u'%s.', u'.%s', u'.%s.'] for ptrn in patterns: flexFormatted = self._replace.sub(self.marker, ptrn % flex) # in a pattern flex, # add missing dots and replace them all with a number sign self.contents[flexFormatted] = flex # inside the keys, a number sign only # is used as an empty transition marker. However, values look like a normal flex. FlexAutomaton.add(self, flexFormatted)