Beispiel #1
0
 def test_tag_to_function(self):
     """
     Try getting a function for every tag and check it's in the 
     set of allowed functions.
     
     """
     g = Grammar()
     for tag in g.pos_tags:
         fun = g.tag_to_function(tag)
         if fun is None:
             warnings.warn("Tag %s has no function given by the "\
                 "grammar" % tag)
         else:
             self.assertIn(fun, ['T','D','S','Pass'])