#NEWLINE# def test_node_simple( self ) : #NEWLINE# #INDENT# '\n        Test a simple use of tgrep for finding nodes matching a given\n        pattern.\n        ' #NEWLINE# tree = ParentedTree . fromstring ( '(S (NP (DT the) (JJ big) (NN dog)) (VP bit) (NP (DT a) (NN cat)))' ) #NEWLINE# self . assertEqual ( list ( tgrep . tgrep_positions ( 'NN' , [ self ] ) ) , [ [ ( 0 , 2 ) , ( 2 , 1 ) ] ] ) #NEWLINE# self . assertEqual ( list ( tgrep . tgrep_nodes ( 'NN' , [ tree ] ) ) , [ [ tree [ ( 0 , 2 ) ] , tree [ ( 2 , 1 ) ] ] ] ) #NEWLINE# self . assertEqual ( list ( tgrep . tgrep_positions ( 'NN|JJ' , [ tree ] ) ) , [ [ ( 0 , 1 ) , ( 0 , 2 ) , ( 2 , 1 ) ] ] )