Skip to content

Commit ae90889

Browse files
committed
Add a labels() call which takes the place of extracting the labels from classIndex, which essentially doesn't exist in RegexNERSequenceClassifier. ClassifierCombiner expects this call to work
1 parent d09307b commit ae90889

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/edu/stanford/nlp/ie/regexp/RegexNERSequenceClassifier.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ public RegexNERSequenceClassifier(BufferedReader reader,
168168
// log.info("RegexNER using labels: " + myLabels);
169169
}
170170

171+
/**
172+
* Most AbstractSequenceClassifiers have classIndex set.
173+
* ClassifierCombiner calls labels() to get the values from the
174+
* index.
175+
* <br>
176+
* TODO: chceck that classIndex isn't used anywhere other than the
177+
* call to labels()
178+
*/
179+
@Override
180+
public Set<String> labels() {
181+
return myLabels;
182+
}
183+
171184
private static class Entry implements Comparable<Entry> {
172185
public List<Pattern> regex; // the regex, tokenized by splitting on white space
173186
public List<String> exact = new ArrayList<>();

0 commit comments

Comments
 (0)