From 8ef9a588b367ca7bfdf21568bc23e36b9f40d610 Mon Sep 17 00:00:00 2001 From: churow Date: Mon, 17 Mar 2025 10:52:30 +0900 Subject: [PATCH] added lemmas to tsv even without verbose output format option --- src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java b/src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java index 6d7d20f88c..1d57b9796a 100644 --- a/src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java +++ b/src/edu/stanford/nlp/tagger/maxent/MaxentTagger.java @@ -1435,8 +1435,16 @@ private static String getTsvWords(boolean verbose, boolean outputLemmas, throw new IllegalArgumentException("Expected HasTags, got " + hw.getClass()); } + sb.append(word); + sb.append('\t'); + if (outputLemmas) { + String lemma = ((HasLemma) hw).lemma(); + sb.append(lemma); + sb.append("\t"); + } String tag = ((HasTag) hw).tag(); - sb.append(word).append('\t').append(tag).append('\n'); + sb.append(tag); + sb.append('\n'); } sb.append('\n'); return sb.toString();