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

Method __init__

pattern/text/tree.py:1044–1054  ·  view source on GitHub ↗

A list of Sentence objects parsed from the given string. The string is the Unicode return value from parse().

(self, string, token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA], language="en", encoding="utf-8")

Source from the content-addressed store, hash-verified

1042class Text(list):
1043
1044 def __init__(self, string, token=[WORD, POS, CHUNK, PNP, REL, ANCHOR, LEMMA], language="en", encoding="utf-8"):
1045 """ A list of Sentence objects parsed from the given string.
1046 The string is the Unicode return value from parse().
1047 """
1048 self.encoding = encoding
1049 # Extract token format from TokenString if possible.
1050 if _is_tokenstring(string):
1051 token, language = string.tags, getattr(string, "language", language)
1052 if string:
1053 for s in string.split("\n"):
1054 self.append(Sentence(s, token, language))
1055
1056 def insert(self, index, sentence):
1057 list.insert(self, index, sentence)

Callers

nothing calls this directly

Calls 4

appendMethod · 0.95
_is_tokenstringFunction · 0.85
SentenceClass · 0.70
splitMethod · 0.45

Tested by

no test coverage detected