nltk.CFG.leftcorners

CFG.leftcorners(cat)[source]

Return the set of all nonterminals that the given nonterminal can start with, including itself.

This is the reflexive, transitive closure of the immediate leftcorner relation: (A > B) iff (A -> B beta)

Parameters:cat (Nonterminal) – the parent of the leftcorners
Returns:the set of all leftcorners
Return type:set(Nonterminal)