Commit 35cbe3f5 by Steven Bird

corrected module name in docstring

parent e5934cb2
...@@ -27,15 +27,15 @@ Usage ...@@ -27,15 +27,15 @@ Usage
===== =====
>>> from nltk.tree import ParentedTree >>> from nltk.tree import ParentedTree
>>> import nltk_tgrep >>> from nltk import tgrep
>>> tree = ParentedTree.fromstring('(S (NP (DT the) (JJ big) (NN dog)) (VP bit) (NP (DT a) (NN cat)))') >>> tree = ParentedTree.fromstring('(S (NP (DT the) (JJ big) (NN dog)) (VP bit) (NP (DT a) (NN cat)))')
>>> nltk_tgrep.tgrep_nodes(tree, 'NN') >>> tgrep.tgrep_nodes(tree, 'NN')
[ParentedTree('NN', ['dog']), ParentedTree('NN', ['cat'])] [ParentedTree('NN', ['dog']), ParentedTree('NN', ['cat'])]
>>> nltk_tgrep.tgrep_positions(tree, 'NN') >>> tgrep.tgrep_positions(tree, 'NN')
[(0, 2), (2, 1)] [(0, 2), (2, 1)]
>>> nltk_tgrep.tgrep_nodes(tree, 'DT') >>> tgrep.tgrep_nodes(tree, 'DT')
[ParentedTree('DT', ['the']), ParentedTree('DT', ['a'])] [ParentedTree('DT', ['the']), ParentedTree('DT', ['a'])]
>>> nltk_tgrep.tgrep_nodes(tree, 'DT $ JJ') >>> tgrep.tgrep_nodes(tree, 'DT $ JJ')
[ParentedTree('DT', ['the'])] [ParentedTree('DT', ['the'])]
This implementation adds syntax to select nodes based on their NLTK This implementation adds syntax to select nodes based on their NLTK
...@@ -48,7 +48,7 @@ valid node selectors. Example: ...@@ -48,7 +48,7 @@ valid node selectors. Example:
ParentedTree('DT', ['the']) ParentedTree('DT', ['the'])
>>> tree[0,0].treeposition() >>> tree[0,0].treeposition()
(0, 0) (0, 0)
>>> nltk_tgrep.tgrep_nodes(tree, 'N(0,0)') >>> tgrep.tgrep_nodes(tree, 'N(0,0)')
[ParentedTree('DT', ['the'])] [ParentedTree('DT', ['the'])]
Caveats: Caveats:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment