Skip to content

Commit c03522b

Browse files
committed
Remove the part of the CoreLabel API which removes the lemma when the word is updated. It was kinda annoying and a lot of people seem to dislike it.
1 parent 6707a52 commit c03522b

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/edu/stanford/nlp/ling/CoreLabel.java

-8
Original file line numberDiff line numberDiff line change
@@ -386,14 +386,6 @@ public final String value() {
386386
public void setWord(String word) {
387387
String originalWord = get(CoreAnnotations.TextAnnotation.class);
388388
set(CoreAnnotations.TextAnnotation.class, word);
389-
// Pado feb 09: if you change the word, delete the lemma.
390-
// Gabor dec 2012: check if there was a real change -- this remove is actually rather expensive if it gets called a lot
391-
// todo [cdm 2015]: probably no one now knows why this was even needed, but maybe it should just be removed. It's kind of weird.
392-
if (word != null && !word.equals(originalWord) && containsKey(CoreAnnotations.LemmaAnnotation.class)) {
393-
remove(CoreAnnotations.LemmaAnnotation.class);
394-
// [cdm 2021] The only unit test that depends on this code is the one that tests for this exact behavior! Remove?
395-
// throw new IllegalStateException("Looks like your code is relying on a dirty branch in setWord() that we want to remove!");
396-
}
397389
}
398390

399391
/**

0 commit comments

Comments
 (0)