I am stuck in a program. I can't post only the part of the code with error because it is dependent on the rest of the code. So, I have posted the complete code in the link below. Just look at like no. 113 and 114. When I am using
fs = fsa.final_state
AttributeError: 'int' object has no attribute 'final_state'
I've looked through your code. On this line here:
print("'%s'\t%s" % (input, NDRecognize(input, days)))
Your passing the parameter
NDRecognize. But when I do
print(type(days)) I get
int. However the
days parameter is passed through to
loop() and then
fsa until you try to access one of it's properties, where the error occurs.
In short, your passing an
int as fsa, not an actual
FSA object. You'll have to create it and then pass that through as a parameter.
Around line 260 you write
days = 31 which overrides the days declaration from earlier in the program on line 72. You don't redefine
months however, which is why it works for
months but not for