From cc579ed429cd083106761b6695b5707d2bab6c69 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 23 Jun 2015 00:02:50 +0200 Subject: [PATCH] * Add __len__ function to StringStore --- spacy/strings.pyx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacy/strings.pyx b/spacy/strings.pyx index e15f88837..56df4d2f1 100644 --- a/spacy/strings.pyx +++ b/spacy/strings.pyx @@ -61,6 +61,9 @@ cdef class StringStore: def __get__(self): return self.size-1 + def __len__(self): + return self.size + def __getitem__(self, object string_or_id): cdef bytes byte_string cdef const Utf8Str* utf8str