From 2962c4f08dbaa707f051e2dc0ee40ff9fde7ff34 Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Fri, 5 Jan 2024 15:53:53 +0100 Subject: [PATCH] adapt to extended format --- .../main/java/org/languagetool/server/V2TextChecker.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java b/languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java index 314b07ee9283..849a7bfd4d6e 100644 --- a/languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java +++ b/languagetool-server/src/main/java/org/languagetool/server/V2TextChecker.java @@ -66,16 +66,16 @@ private void loadConfidenceMap() throws IOException { if (line.startsWith("#")) { continue; } - String[] parts = line.split(";"); - if (parts.length == 2) { + String[] parts = line.split(","); + if (parts.length >= 2) { try { float confidence = Float.parseFloat(parts[1]); ruleIdToConfidence.put(parts[0], confidence); } catch (NumberFormatException e) { - throw new RuntimeException("Invalid confidence float value in " + config.getRuleIdToConfidenceFile() + ", expected 'RULE_ID;float_value': " + line); + throw new RuntimeException("Invalid confidence float value in " + config.getRuleIdToConfidenceFile() + ", expected 'RULE_ID,float_value[,...]': " + line); } } else { - throw new RuntimeException("Invalid line in " + config.getRuleIdToConfidenceFile() + ", expected 'RULE_ID;float_value': " + line); + throw new RuntimeException("Invalid line in " + config.getRuleIdToConfidenceFile() + ", expected 'RULE_ID,float_value[,...]': " + line); } } }