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

Method find_tokens

pattern/text/__init__.py:511–520  ·  view source on GitHub ↗

Returns a list of sentences from the given string. Punctuation marks are separated from each word by a space.

(self, string, **kwargs)

Source from the content-addressed store, hash-verified

509 self.language = language
510
511 def find_tokens(self, string, **kwargs):
512 """ Returns a list of sentences from the given string.
513 Punctuation marks are separated from each word by a space.
514 """
515 # "The cat purs." => ["The cat purs ."]
516 return find_tokens(string,
517 punctuation = kwargs.get( "punctuation", PUNCTUATION),
518 abbreviations = kwargs.get("abbreviations", ABBREVIATIONS),
519 replace = kwargs.get( "replace", replacements),
520 linebreak = r"\n{2,}")
521
522 def find_tags(self, tokens, **kwargs):
523 """ Annotates the given list of tokens with part-of-speech tags.

Callers 2

parseMethod · 0.95
test_find_tokensMethod · 0.95

Calls 2

find_tokensFunction · 0.85
getMethod · 0.45

Tested by 1

test_find_tokensMethod · 0.76