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

Method find_chunks

pattern/text/__init__.py:533–541  ·  view source on GitHub ↗

Annotates the given list of tokens with chunk tags. Several tags can be added, for example chunk + preposition tags.

(self, tokens, **kwargs)

Source from the content-addressed store, hash-verified

531 map = kwargs.get( "map", None))
532
533 def find_chunks(self, tokens, **kwargs):
534 """ Annotates the given list of tokens with chunk tags.
535 Several tags can be added, for example chunk + preposition tags.
536 """
537 # [["The", "DT"], ["cat", "NN"], ["purs", "VB"]] =>
538 # [["The", "DT", "B-NP"], ["cat", "NN", "I-NP"], ["purs", "VB", "B-VP"]]
539 return find_prepositions(
540 find_chunks(tokens,
541 language = kwargs.get("language", self.language)))
542
543 def find_prepositions(self, tokens, **kwargs):
544 """ Annotates the given list of tokens with prepositional noun phrase tags.

Callers 3

parseMethod · 0.95
test_find_chunksMethod · 0.95
test_find_chunksMethod · 0.45

Calls 3

find_prepositionsFunction · 0.85
find_chunksFunction · 0.85
getMethod · 0.45

Tested by 2

test_find_chunksMethod · 0.76
test_find_chunksMethod · 0.36