From 87bf205b82ce2bec7730688ab934b7c324401a6d Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 7 Jul 2014 23:26:01 +0200 Subject: [PATCH] * Fix open apostrophe bug --- spacy/en.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/en.pyx b/spacy/en.pyx index 35204a3df..bbcfaf119 100644 --- a/spacy/en.pyx +++ b/spacy/en.pyx @@ -36,7 +36,8 @@ cdef class English(spacy.Language): cdef bint is_punct(unicode word, size_t i, size_t length): # Don't count appostrophes as punct if the next char is a letter if word[i] == "'" and i < (length - 1) and word[i+1].isalpha(): - return False + # ...Unless we're at 0 + return i == 0 # Don't count commas as punct if the next char is a number if word[i] == "," and i < (length - 1) and word[i+1].isdigit(): return False