Skip to content

Commit

Permalink
adapt to extended format
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaber committed Jan 5, 2024
1 parent 412c0cf commit 2962c4f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 2962c4f

Please sign in to comment.