From 71b009e3232d923b8719a21d57ddc6ce3ba63c5c Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 3 Dec 2014 11:02:24 +1100 Subject: [PATCH] * Fix bug in refactored StringStore.__getitem__ --- spacy/utf8string.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/utf8string.pyx b/spacy/utf8string.pyx index 426b531f4..0384a150c 100644 --- a/spacy/utf8string.pyx +++ b/spacy/utf8string.pyx @@ -5,6 +5,7 @@ import codecs SEPARATOR = '\n|-SEP-|\n' + cdef class StringStore: def __init__(self): self.mem = Pool() @@ -20,7 +21,7 @@ cdef class StringStore: def __getitem__(self, object string_or_id): cdef bytes byte_string cdef Utf8Str* utf8str - if isinstance(string_or_id, int): + if isinstance(string_or_id, int) or isinstance(string_or_id, long): if string_or_id < 1 or string_or_id >= self.size: raise IndexError(string_or_id) utf8str = &self.strings[string_or_id]