class_docstr: Class containing unit tests for nltk.tgrep.
class_docstr_tok: ["Class","containing","unit","tests","for","nltk.tgrep","."]
docstr: Test that comments are correctly filtered out of tgrep search
  strings.
docstr_tok: ["Test","that","comments","are","correctly","filtered","out","of","tgrep","search","strings","."]
code: def test_comments(self):
      """
      Test that comments are correctly filtered out of tgrep search
      strings.
      """
      tree = ParentedTree.fromstring("(S (NN x) (NP x) (NN x))")
      search1 = """
          @ NP /^NP/;
          @ NN /^NN/;
          @NN
          """
      self.assertEqual(
          list(tgrep.tgrep_positions(search1, [tree])), [[(0,), (2,)]]
      )
      search2 = """
          # macros
          @ NP /^NP/;
          @ NN /^NN/;
  
          # search string
          @NN
          """
      self.assertEqual(
          list(tgrep.tgrep_positions(search2, [tree])), [[(0,), (2,)]]
      )
  
imports: import unittest
  from nltk import tgrep
  from nltk.tree import ParentedTree
label_desc: Use image node_id 19 for calling the TestSequenceFunctions obj's underlying member method code with example usage: obj.test_comments() without return types