From e9d0310daed70cba17f1841eba8423652a77f03c Mon Sep 17 00:00:00 2001 From: Andriy Rysin Date: Thu, 4 Apr 2024 11:12:12 -0400 Subject: [PATCH] -g implies -t1 and -u --- .../ua/net/nlp/tools/tag/TagOptions.groovy | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/groovy/ua/net/nlp/tools/tag/TagOptions.groovy b/src/main/groovy/ua/net/nlp/tools/tag/TagOptions.groovy index 9a09cd7..17f2360 100644 --- a/src/main/groovy/ua/net/nlp/tools/tag/TagOptions.groovy +++ b/src/main/groovy/ua/net/nlp/tools/tag/TagOptions.groovy @@ -49,7 +49,7 @@ public class TagOptions extends OptionsBase { @Option(names = ["-d", "--showDisambigRules"], description = "Show deterministic disambiguation rules applied") boolean showDisambigRules - @Option(names = ["-g", "--disambiguate"], description = "Use statistics for disambiguation") + @Option(names = ["-g", "--disambiguate"], description = "Use statistics for disambiguation (implies -t1 abd -u)") boolean disambiguate @Option(names = ["-gr", "--disambiguationRate"], description = "Show a disambiguated token ratings") boolean showDisambigRate @@ -95,20 +95,28 @@ public class TagOptions extends OptionsBase { disambiguate = true singleTokenOnly = true } + if( ! outputFormat ) { outputFormat = outputFormat.xml } - if( singleTokenOnly ) { - tokenFormat = true + else if( outputFormat == OutputFormat.txt ) { + setLemmaForUnknown = true } + if( showDisambigRate || disambiguationDebug ) { disambiguate = true } - if( unknownRate ) { + if( disambiguate ) { + tokenFormat = true + singleTokenOnly = true tagUnknown = true } - if( outputFormat == OutputFormat.txt ) { - setLemmaForUnknown = true + + if( singleTokenOnly ) { + tokenFormat = true + } + if( unknownRate ) { + tagUnknown = true } if( ! quiet ) {