tarsqi / ttk

Tarsqi Toolkit
Apache License 2.0
25 stars 10 forks source link

Reversing an FSA fails #96

Open marcverhagen opened 3 years ago

marcverhagen commented 3 years ago

The utilities/FSA.py script has an error in that you cannot reverse an FSA.

To replicate start python2 from the main directory and do this:

>>> from utilities import FSA
>>> fsa3 = FSA.compileOP(['(','a','|','the',')', 'very', '*', '(', 'boring','|','nice', ')', '+', 'movie'])
>>> FSA.reverse(fsa3)

You will get an error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "utilities/FSA.py", line 1176, in reverse
    [initial])
  File "utilities/FSA.py", line 419, in create
    return apply(self.__class__, args)
TypeError: __init__() takes at least 6 arguments (5 given)