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

Method constraint

pattern/text/search.py:938–942  ·  view source on GitHub ↗

Returns the constraint that matches the given Word, or None.

(self, word)

Source from the content-addressed store, hash-verified

936 return self.words and self.words[-1].index+1 or None
937
938 def constraint(self, word):
939 """ Returns the constraint that matches the given Word, or None.
940 """
941 if word.index in self._map1:
942 return self._map1[word.index]
943
944 def constraints(self, chunk):
945 """ Returns a list of constraints that match the given Chunk.

Callers 7

groupMethod · 0.95
test_matchMethod · 0.80
05-multiple.pyFile · 0.80
02-constraint.pyFile · 0.80
03-lemmata.pyFile · 0.80
09-groups.pyFile · 0.80
06-optional.pyFile · 0.80

Calls

no outgoing calls

Tested by 1

test_matchMethod · 0.64