nltk.ProbabilisticDependencyGrammar.contains

ProbabilisticDependencyGrammar.contains(head, mod)[source]

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

Parameters:
  • head (str) – A head word.
  • mod (str) – A mod word, to test as a modifier of ‘head’.
Return type:

bool