From c20dd79748e928384722df113473d207b26a7893 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 8 Dec 2014 00:03:55 +1100 Subject: [PATCH] * Fiddle with const correctness and comments --- spacy/tagger.pxd | 2 +- spacy/tagger.pyx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/tagger.pxd b/spacy/tagger.pxd index 39ba7ed41..f91bbeb0a 100644 --- a/spacy/tagger.pxd +++ b/spacy/tagger.pxd @@ -9,7 +9,7 @@ from .tokens cimport Tokens cdef class Tagger: - cdef class_t predict(self, atom_t* context, object golds=*) except * + cdef class_t predict(self, const atom_t* context, object golds=*) except * cpdef readonly Pool mem cpdef readonly Extractor extractor diff --git a/spacy/tagger.pyx b/spacy/tagger.pyx index e0cd0bf3b..22ec3896a 100644 --- a/spacy/tagger.pyx +++ b/spacy/tagger.pyx @@ -26,8 +26,8 @@ def setup_model_dir(tag_names, tag_counts, templates, model_dir): cdef class Tagger: - """Assign part-of-speech, named entity or supersense tags, using greedy - decoding. The tagger reads its model and configuration from disk. + """Predict some type of tag, using greedy decoding. The tagger reads its + model and configuration from disk. """ def __init__(self, model_dir): self.mem = Pool() @@ -40,7 +40,7 @@ cdef class Tagger: if path.exists(path.join(model_dir, 'model')): self.model.load(path.join(model_dir, 'model')) - cdef class_t predict(self, atom_t* context, object golds=None) except *: + cdef class_t predict(self, const atom_t* context, object golds=None) except *: """Predict the tag of tokens[i]. The tagger remembers the features and prediction, in case you later call tell_answer.