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

Class Lexicon

pattern/text/__init__.py:218–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 raise StopIteration
217
218class Lexicon(lazydict):
219
220 def __init__(self, path="", morphology=None, context=None, entities=None, NNP="NNP", language=None):
221 """ A dictionary of words and their part-of-speech tags.
222 For unknown words, rules for word morphology, context and named entities can be used.
223 """
224 self._path = path
225 self._language = language
226 self.morphology = Morphology(self, path=morphology)
227 self.context = Context(self, path=context)
228 self.entities = Entities(self, path=entities, tag=NNP)
229
230 def load(self):
231 # Arnold NNP x
232 dict.update(self, (x.split(" ")[:2] for x in _read(self._path)))
233
234 @property
235 def path(self):
236 return self._path
237
238 @property
239 def language(self):
240 return self._language
241
242#--- MORPHOLOGICAL RULES ---------------------------------------------------------------------------
243# Brill's algorithm generates lexical (i.e., morphological) rules in the following format:

Callers 7

__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90
__init__.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…