Skip to content

Commit

Permalink
drop the string initialization of Tree
Browse files Browse the repository at this point in the history
  • Loading branch information
SocialfiPanda committed Jun 1, 2014
1 parent 2ff9729 commit 5abff43
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions nltk/test/tree.doctest
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,6 @@ tree object to one of several standard tree encodings:
[.dp [.d the ] [.np dog ] ]
[.vp [.v chased ] [.dp [.d the ] [.np cat ] ] ] ]

Trees can be initialized from treebank strings:

>>> tree2 = Tree('(S (NP I) (VP (V enjoyed) (NP my cookie)))')
>>> print(tree2)
(S (NP I) (VP (V enjoyed) (NP my cookie)))

Trees can be compared for equality:

>>> tree == Tree(str(tree))
True
>>> tree2 == Tree(str(tree2))
True
>>> tree == tree2
False
>>> tree == Tree(str(tree2))
False
>>> tree2 == Tree(str(tree))
False

>>> tree != Tree(str(tree))
False
>>> tree2 != Tree(str(tree2))
False
>>> tree != tree2
True
>>> tree != Tree(str(tree2))
True
>>> tree2 != Tree(str(tree))
True

>>> tree < tree2 or tree > tree2
True

Tree Parsing
============

Expand Down Expand Up @@ -1075,4 +1042,3 @@ This used to discard the ``(B b)`` subtree (fixed in svn 6270):
>>> print(Tree.fromstring('((A a) (B b))'))
( (A a) (B b))


0 comments on commit 5abff43

Please sign in to comment.