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

Implement get_refs function for DrtLambdaExpression #2847

Merged
merged 2 commits into from Oct 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions nltk/sem/drt.py
Expand Up @@ -717,6 +717,12 @@ def _pretty(self):
+ [" " + blank + line for line in term_lines[3:]]
)

def get_refs(self, recursive=False):
""":see: AbstractExpression.get_refs()"""
return (
[self.variable] + self.term.get_refs(True) if recursive else [self.variable]
)


class DrtBinaryExpression(DrtExpression, BinaryExpression):
def get_refs(self, recursive=False):
Expand Down