Skip to content

Commit

Permalink
Function rename (piskvorky#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopusz committed Jan 22, 2020
1 parent 6009f0d commit ea02091
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gensim/test/test_fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ def test_cbow(self):


def _read_wordvectors_using_fasttext(fasttext_fname, words):
def _conv_line_to_array(line):
def line_to_array(line):
return np.array([float(s) for s in line.split()[1:]], dtype=np.float32)

cmd = [FT_CMD, "print-word-vectors", fasttext_fname]
Expand All @@ -1454,7 +1454,7 @@ def _conv_line_to_array(line):
stdout=subprocess.PIPE)
words_str = '\n'.join(words)
out, _ = process.communicate(input=words_str.encode("utf-8"))
return np.array([_conv_line_to_array(l) for l in out.splitlines()], dtype=np.float32)
return np.array([line_to_array(l) for l in out.splitlines()], dtype=np.float32)


@unittest.skipIf(not os.environ.get("FT_HOME", None), "FT_HOME env variable not set, skipping test")
Expand Down

0 comments on commit ea02091

Please sign in to comment.