Skip to content

Commit

Permalink
Revert "Merge pull request #836 from raphael0202/load_vectors (closes #…
Browse files Browse the repository at this point in the history
…834)"

This reverts commit 7d8c9ee, reversing
changes made to f6b69ba.
  • Loading branch information
ines committed Feb 16, 2017
1 parent 0836cbe commit ea05f78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
15 changes: 0 additions & 15 deletions spacy/tests/regression/test_issue834.py

This file was deleted.

13 changes: 8 additions & 5 deletions spacy/vocab.pyx
@@ -1,17 +1,22 @@
from __future__ import unicode_literals

from libc.stdio cimport fopen, fclose, fread, fwrite, FILE
from libc.string cimport memset
from libc.stdint cimport int32_t
from libc.stdint cimport uint64_t
from libc.math cimport sqrt

from pathlib import Path
import bz2
import io
import math
import ujson as json
import re
import tempfile

from .lexeme cimport EMPTY_LEXEME
from .lexeme cimport Lexeme
from .strings cimport hash_string
from .orth cimport word_shape
from .typedefs cimport attr_t
from .cfile cimport CFile
from .lemmatizer import Lemmatizer
Expand All @@ -24,6 +29,7 @@ from . import symbols
from cymem.cymem cimport Address
from .serialize.packer cimport Packer
from .attrs cimport PROB, LANG
from . import deprecated
from . import util


Expand Down Expand Up @@ -471,12 +477,9 @@ cdef class Vocab:
cdef attr_t orth
cdef int32_t vec_len = -1
cdef double norm = 0.0

whitespace_pattern = re.compile(r'\s')

for line_num, line in enumerate(file_):
pieces = line.split()
word_str = " " if whitespace_pattern.match(line) else 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):
Expand Down

0 comments on commit ea05f78

Please sign in to comment.