nltk.DependencyGrammar.contains

DependencyGrammar.contains(head, mod)[source]
Parameters:
  • head (str) – A head word.
  • mod (str) – A mod word, to test as a modifier of ‘head’.
Returns:

true if this DependencyGrammar contains a DependencyProduction mapping ‘head’ to ‘mod’.

Return type:

bool