def test_examples(self):
        tree = ParentedTree.fromstring('(S (NP (AP x)) (NP (PP x)))')
        # This matches any NP node that immediately dominates a PP:
        self.assertEqual(list(tgrep.tgrep_positions('NP < PP', [tree])),
                         [[(1,)]])

        tree = ParentedTree.fromstring('(S (NP x) (VP x) (NP (PP x)) (VP x))')
        # This matches an NP that dominates a PP and is immediately
        # followed by a VP:
        self.assertEqual(list(tgrep.tgrep_positions('NP << PP . VP', [tree])),
                         [[(2,)]])

        tree = ParentedTree.fromstring('(S (NP (AP x)) (NP (PP x)) '
                                       '(NP (DET x) (NN x)) (VP x))')
        # This matches an NP that dominates a PP or is immediately
        # followed by a VP:
        self.assertEqual(list(tgrep.tgrep_positions('NP << PP | . VP', [tree])),
                         [[(1,), (2,)]])

        tree = ParentedTree.fromstring('(S (NP (NP (PP x)) (NP (AP x)))'
                                       ' (VP (AP (NP (PP x)) (NP (AP x))))'
                                       ' (NP (RC (NP (AP x)))))')
        # This matches an NP that does not dominate a PP. Also, the NP
        # must either have a parent that is an NP or be dominated by a
        # VP:
        self.assertEqual(list(tgrep.tgrep_positions(
                                               'NP !<< PP [> NP | >> VP]', [tree])),
                         [[(0, 1), (1, 0, 1)]])

        tree = ParentedTree.fromstring('(S (NP (AP (PP x) (VP x))) '
                                       '(NP (AP (PP x) (NP x))) (NP x))')
        # This matches an NP that dominates a PP which itself is
        # immediately followed by a VP. Note the use of parentheses to
        # group ". VP" with the PP rather than with the NP:
        self.assertEqual(list(tgrep.tgrep_positions('NP << (PP . VP)', [tree])),
                         [[(0,)]])

        tree = ParentedTree.fromstring(
            '(S (NP (DET a) (NN cat) (PP (IN on) (NP x)))'
            ' (NP (DET a) (NN cat) (PP (IN on) (NP x)) (PP x))'
            ' (NP x))')
        # This matches an NP whose last child is a PP that begins with
        # the preposition "on":
        self.assertEqual(list(tgrep.tgrep_positions(
                                               'NP <\' (PP <, (IN < on))', [tree])),
                         [[(0,)]])

        tree = ParentedTree.fromstring(
            '(S (S (C x) (A (B x))) (S (C x) (A x)) '
            '(S (D x) (A (B x))))')
        # The following pattern matches an S which has a child A and
        # another child that is a C and that the A has a child B:
        self.assertEqual(list(tgrep.tgrep_positions('S < (A < B) < C', [tree])),
                         [[(0,)]])

        tree = ParentedTree.fromstring(
            '(S (S (A (B x) (C x))) (S (S (C x) (A (B x)))))')
        # However, this pattern means that S has child A and that A
        # has children B and C:
        self.assertEqual(list(tgrep.tgrep_positions('S < ((A < B) < C)', [tree])),
                         [[(0,)]])

        # It is equivalent to this:
        self.assertEqual(list(tgrep.tgrep_positions('S < (A < B < C)', [tree])),
                         [[(0,)]])
Returns the times when this search is scheduled to run.
dataset/ETHPy150Open nltk/nltk/nltk/test/unit/test_tgrep.py/TestSequenceFunctions.test_examples--crossover with--dataset/ETHPy150Open hvandenb/splunk-elasticsearch/search-elasticsearch/bin/splunklib/client.py/SavedSearch.scheduled_times