mirror of https://github.com/explosion/spaCy.git
Test #743: Tokens unhashable.
This commit is contained in:
parent
48c712f1c1
commit
2c60d0cb1e
|
@ -0,0 +1,11 @@
|
||||||
|
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
|
Loading…
Reference in New Issue