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

Method __init__

pattern/text/search.py:34–41  ·  view source on GitHub ↗

A list of words, where punctuation marks are split from words.

(self, string="", token=["word"])

Source from the content-addressed store, hash-verified

32class Sentence(list):
33
34 def __init__(self, string="", token=["word"]):
35 """ A list of words, where punctuation marks are split from words.
36 """
37 for ch in PUNCTUATION: # Naive tokenization.
38 string = string.replace(ch, " %s " % ch)
39 string = re.sub(r"\s+", " ", string)
40 string = string.split(" ")
41 list.__init__(self, (Word(self, w, index=i) for i, w in enumerate(string)))
42
43 @property
44 def words(self):

Callers

nothing calls this directly

Calls 3

WordClass · 0.70
splitMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected