Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError in lambda DRT simplification. #2844

Closed
RnDevelover opened this issue Oct 6, 2021 · 1 comment · Fixed by #2847
Closed

NotImplementedError in lambda DRT simplification. #2844

RnDevelover opened this issue Oct 6, 2021 · 1 comment · Fixed by #2847

Comments

@RnDevelover
Copy link
Contributor

RnDevelover commented Oct 6, 2021

The following piece of code gives NotImplementedError on line 264 of drt.py (3.6.4)

import nltk
expr="\P.\Q.\R.(([X], []) + R(X) + ((P(\Y.([],[ (X=Y) ]))) + (Q(\Z.([], [ (X=Z) ])))))(\X.(\P.(([X],[named(X, karla)]) + P(X) )(\X1.(X(X1)))))(\Y.(\P.\Q. (([X],[ant(X)]) + P(X) + Q(X) )(\Y1.(\X.([],[owner(X) ] )(Y1)))(\Z1.(Y(Z1)))))(\Z.(\P.\X.\F.(P(\E.(([],[nsubj(E,X)]) + F(E))))(\X2.(\F.(([E][arrive(E)]) + F(E) )(\Z2.(X2(Z2)))))(Z)(\Y2.(\F.( [],[] )(Y2)))))"
dexpr = nltk.sem.drt.DrtExpression.fromstring(r"{}".format(expr))
dexpr.simplify()
print(str(dexpr))

When I track the cause, I find that it is happening when get_refs is called in DrtLambdaExpression. Since it does not exist, the get_refs function of the abstract class is called (line 264) giving a not implemented error.

@RnDevelover
Copy link
Contributor Author

I made a pull request that fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant