MCPcopy Index your code
hub / github.com/clips/pattern / pprint

Function pprint

pattern/text/__init__.py:88–97  ·  view source on GitHub ↗

Pretty-prints the output of Parser.parse() as a table with outlined columns. Alternatively, you can supply a tree.Text or tree.Sentence object.

(string, token=[WORD, POS, CHUNK, PNP], column=4)

Source from the content-addressed store, hash-verified

86 return g
87
88def pprint(string, token=[WORD, POS, CHUNK, PNP], column=4):
89 """ Pretty-prints the output of Parser.parse() as a table with outlined columns.
90 Alternatively, you can supply a tree.Text or tree.Sentence object.
91 """
92 if isinstance(string, basestring):
93 print "\n\n".join([table(sentence, fill=column) for sentence in Text(string, token)])
94 if isinstance(string, Text):
95 print "\n\n".join([table(sentence, fill=column) for sentence in string])
96 if isinstance(string, Sentence):
97 print table(string, fill=column)
98
99#--- LAZY DICTIONARY -------------------------------------------------------------------------------
100# A lazy dictionary is empty until one of its methods is called.

Callers

nothing calls this directly

Calls 2

tableFunction · 0.90
TextClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…