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
deprecate: deprecate get and set node methods #2900
Conversation
NLTK has implemented a useful decorator for cases like these. I recommend that we use it. See an example below: nltk/nltk/metrics/agreement.py Lines 164 to 178 in edf47c0
i.e. simply adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely preferable, however the _get_node() is deprecated
section of the deprecation message is unnecessary, as @deprecated
already adds this. Right now, the output is:
>>> from nltk.tree import Tree
>>> t = Tree.fromstring('(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))')
>>> t._get_node()
<stdin>:1: DeprecationWarning:
Function _get_node() has been deprecated. _get_node() is
deprecated, use label() instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@12mohaned |
This pull request deprecates _get_node() and _set_node() methods, it was similar to this PR, but I forgot to amend the required changes instead, I accidentally removed the methods. Sorry for the inconvenience @stevenbird .