mirror of https://github.com/explosion/spaCy.git
* 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):
|
||||
self.c.vector[i] = value
|
||||
|
||||
property rank:
|
||||
def __get__(self):
|
||||
return self.c.id
|
||||
|
||||
property repvec:
|
||||
def __get__(self):
|
||||
return self.vector
|
||||
|
|
|
@ -67,6 +67,10 @@ cdef class Token:
|
|||
def __get__(self):
|
||||
return self.c.lex.id
|
||||
|
||||
property rank:
|
||||
def __get__(self):
|
||||
return self.c.lex.id
|
||||
|
||||
property string:
|
||||
def __get__(self):
|
||||
cdef unicode orth = self.vocab.strings[self.c.lex.orth]
|
||||
|
|
Loading…
Reference in New Issue