mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-04 13:40:34 +03:00
* Add .rank property to Token and Lexeme, for frequency rank
This commit is contained in:
parent
fde9a22ec2
commit
ab5aac5b2f
|
@ -83,6 +83,10 @@ cdef class Lexeme:
|
||||||
for i, value in enumerate(vector):
|
for i, value in enumerate(vector):
|
||||||
self.c.vector[i] = value
|
self.c.vector[i] = value
|
||||||
|
|
||||||
|
property rank:
|
||||||
|
def __get__(self):
|
||||||
|
return self.c.id
|
||||||
|
|
||||||
property repvec:
|
property repvec:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.vector
|
return self.vector
|
||||||
|
|
|
@ -67,6 +67,10 @@ cdef class Token:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.c.lex.id
|
return self.c.lex.id
|
||||||
|
|
||||||
|
property rank:
|
||||||
|
def __get__(self):
|
||||||
|
return self.c.lex.id
|
||||||
|
|
||||||
property string:
|
property string:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
cdef unicode orth = self.vocab.strings[self.c.lex.orth]
|
cdef unicode orth = self.vocab.strings[self.c.lex.orth]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user