Revert "Changes to matcher.pyx for new StringStore scheme"

This reverts commit 3ff09614e0.
This commit is contained in:
Matthew Honnibal 2016-09-30 20:20:13 +02:00
parent 1b6b129c04
commit 90baa9c7e6

View File

@ -153,7 +153,7 @@ def _convert_strings(token_specs, string_store):
if isinstance(attr, basestring):
attr = attrs.IDS.get(attr.upper())
if isinstance(value, basestring):
value = string_store.intern(value)
value = string_store[value]
if isinstance(value, bool):
value = int(value)
if attr is not None:
@ -221,9 +221,9 @@ cdef class Matcher:
def add(self, entity_key, etype, attrs, specs):
self._patterns[entity_key] = (etype, dict(attrs), list(specs))
if isinstance(entity_key, basestring):
entity_key = self.vocab.strings.intern(entity_key)
entity_key = self.vocab.strings[entity_key]
if isinstance(etype, basestring):
etype = self.vocab.strings.intern(etype)
etype = self.vocab.strings[etype]
elif etype is None:
etype = -1
# TODO: Do something more clever about multiple patterns for single