spaCy/spacy/tests/regression/test_issue743.py

13 lines
276 B
Python
Raw Normal View History

2017-03-13 14:08:19 +03:00
# coding: utf8
2017-01-16 15:27:26 +03:00
from __future__ import unicode_literals
from ...vocab import Vocab
from ...tokens.doc import Doc
def test_token_is_hashable():
doc = Doc(Vocab(), ['hello', 'world'])
token = doc[0]
s = set([token])
items = list(s)
assert items[0] is token