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

Method _append

pattern/text/search.py:524–545  ·  view source on GitHub ↗
(self, v)

Source from the content-addressed store, hash-verified

522 return C
523
524 def _append(self, v):
525 if v.startswith("!") and self.exclude is None:
526 self.exclude = Constraint()
527 if v.startswith("!"):
528 self.exclude._append(v[1:]); return
529 if "!" in v:
530 v = v.replace("\!", "!")
531 if v != v.upper():
532 self.words.append(v.lower())
533 elif v in TAGS:
534 self.tags.append(v)
535 elif v in CHUNKS:
536 self.chunks.append(v)
537 elif v in ROLES:
538 self.roles.append(v)
539 elif v in self.taxonomy or has_alpha(v):
540 self.taxa.append(v.lower())
541 else:
542 # Uppercase words indicate tags or taxonomy terms.
543 # However, this also matches "*" or "?" or "0.25".
544 # Unless such punctuation is defined in the taxonomy, it is added to Range.words.
545 self.words.append(v.lower())
546
547 def match(self, word):
548 """ Return True if the given Word is part of the constraint:

Callers 1

fromstringMethod · 0.80

Calls 2

ConstraintClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected