* Add .rank property to Token and Lexeme, for frequency rank

This commit is contained in:
Matthew Honnibal 2015-11-08 16:18:25 +01:00
parent fde9a22ec2
commit ab5aac5b2f
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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]