From 99eb494a82490a8c1bb5a7313b1d699af97552e8 Mon Sep 17 00:00:00 2001 From: Daniel Hershcovich Date: Thu, 12 Jan 2017 17:00:14 +0200 Subject: [PATCH] Fix #737: support loading word vectors with " " as a word --- spacy/vocab.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 7b9b705dc..cd2b18f81 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -479,7 +479,7 @@ cdef class Vocab: cdef double norm = 0.0 for line_num, line in enumerate(file_): pieces = line.split() - word_str = pieces.pop(0) + word_str = " " if line.startswith(" ") else pieces.pop(0) if vec_len == -1: vec_len = len(pieces) elif vec_len != len(pieces):