mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
28 lines
466 B
Python
28 lines
466 B
Python
from __future__ import unicode_literals
|
|
|
|
import pytest
|
|
|
|
from spacy.en import lookup, unhash
|
|
import spacy.word
|
|
|
|
|
|
@pytest.fixture
|
|
def C3P0():
|
|
return lookup("C3P0")
|
|
|
|
|
|
def test_shape(C3P0):
|
|
# TODO: Fix this
|
|
assert unhash(C3P0.get_view(2)) == "XdXd"
|
|
|
|
|
|
def test_length():
|
|
t = lookup('the')
|
|
assert t.length == 3
|
|
t = lookup("n't")
|
|
assert t.length == 3
|
|
t = lookup("'s")
|
|
assert t.length == 2
|
|
t = lookup('Xxxx')
|
|
assert t.length == 4
|