mirror of https://github.com/explosion/spaCy.git
* Add pickle test for lemmatizer
This commit is contained in:
parent
0cee928467
commit
dfe0ad51ff
|
@ -1,5 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
import StringIO
|
||||||
|
import pickle
|
||||||
|
|
||||||
from spacy.lemmatizer import Lemmatizer, read_index, read_exc
|
from spacy.lemmatizer import Lemmatizer, read_index, read_exc
|
||||||
from spacy.en import LOCAL_DATA_DIR
|
from spacy.en import LOCAL_DATA_DIR
|
||||||
|
@ -41,3 +43,12 @@ def test_smart_quotes(lemmatizer):
|
||||||
do = lemmatizer.punct
|
do = lemmatizer.punct
|
||||||
assert do('“') == set(['"'])
|
assert do('“') == set(['"'])
|
||||||
assert do('“') == set(['"'])
|
assert do('“') == set(['"'])
|
||||||
|
|
||||||
|
|
||||||
|
def test_pickle_lemmatizer(lemmatizer):
|
||||||
|
file_ = StringIO.StringIO()
|
||||||
|
pickle.dump(lemmatizer, file_)
|
||||||
|
|
||||||
|
file_.seek(0)
|
||||||
|
|
||||||
|
loaded = pickle.load(file_)
|
||||||
|
|
Loading…
Reference in New Issue