Example #1
0
def test_read_w2v_dupped_opened(dupped_vocab, dupped_vectors):
    with open(DATA / W2V_DUPPED, "rb") as f:
        w, wv = read_w2v(f)
    assert w == dupped_vocab
    np.testing.assert_allclose(wv, dupped_vectors)
Example #2
0
def test_read_w2v_opened(gold_vocab, gold_vectors):
    with open(DATA / W2V, "rb") as f:
        w, wv = read_w2v(f)
    assert w == gold_vocab
    np.testing.assert_allclose(wv, gold_vectors)
Example #3
0
def test_read_w2v_dupped_pathlib(dupped_vocab, dupped_vectors):
    w, wv = read_w2v(DATA / W2V_DUPPED)
    assert w == dupped_vocab
    np.testing.assert_allclose(wv, dupped_vectors)
Example #4
0
def test_read_w2v_pathlib(gold_vocab, gold_vectors):
    w, wv = read_w2v(DATA / W2V)
    assert w == gold_vocab
    np.testing.assert_allclose(wv, gold_vectors)