Skip to content

Commit

Permalink
Fix simple typo: voacab -> vocab (#2719)
Browse files Browse the repository at this point in the history
Closes #2718
  • Loading branch information
timgates42 authored and piskvorky committed Jan 1, 2020
1 parent 36ae46f commit cc8188c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gensim/test/test_keyedvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ def setUp(self):
self.vocab_path = datapath("w2v_keyedvectors_load_test.vocab")

def test_load_model_and_vocab_file_strict(self):
"""Test loading model and voacab files which have decoding errors: strict mode"""
"""Test loading model and vocab files which have decoding errors: strict mode"""
with self.assertRaises(UnicodeDecodeError):
gensim.models.KeyedVectors.load_word2vec_format(
self.model_path, fvocab=self.vocab_path, binary=False, unicode_errors="strict")

def test_load_model_and_vocab_file_replace(self):
"""Test loading model and voacab files which have decoding errors: replace mode"""
"""Test loading model and vocab files which have decoding errors: replace mode"""
model = gensim.models.KeyedVectors.load_word2vec_format(
self.model_path, fvocab=self.vocab_path, binary=False, unicode_errors="replace")
self.assertEqual(model.vocab[u'ありがとう�'].count, 123)
Expand All @@ -386,7 +386,7 @@ def test_load_model_and_vocab_file_replace(self):
model.get_vector(u'どういたしまして�'), np.array([.1, .2, .3], dtype=np.float32)))

def test_load_model_and_vocab_file_ignore(self):
"""Test loading model and voacab files which have decoding errors: ignore mode"""
"""Test loading model and vocab files which have decoding errors: ignore mode"""
model = gensim.models.KeyedVectors.load_word2vec_format(
self.model_path, fvocab=self.vocab_path, binary=False, unicode_errors="ignore")
print(model.vocab.keys())
Expand Down

0 comments on commit cc8188c

Please sign in to comment.