Skip to content

Commit

Permalink
Implement get_refs function for DrtLambdaExpression (#2847)
Browse files Browse the repository at this point in the history
* Implement get_refs function for DrtLambdaExpression

* Update format

Co-authored-by: Ahmet Yildirim <ahmet.yildirim@iln.uio.no>
  • Loading branch information
RnDevelover and Ahmet Yildirim committed Oct 9, 2021
1 parent 3dcfeb1 commit 6d39c90
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 6d39c90

Please sign in to comment.