Skip to content

Commit

Permalink
move confidence below rule to avoid duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaber committed Jan 5, 2024
1 parent 2962c4f commit c077841
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,6 @@ private void writeReplacements(JsonGenerator g, RuleMatch match) throws IOExcept
}
if (replacement.getConfidence() != null) {
g.writeNumberField("confidence", replacement.getConfidence());
} else if (ruleIdToConfidence != null) {
Float confidence = ruleIdToConfidence.get(match.getRule().getId());
if (confidence != null) {
g.writeNumberField("confidence", confidence);
}
}
g.writeEndObject();
}
Expand Down Expand Up @@ -361,6 +356,12 @@ private void writeRule(JsonGenerator g, RuleMatch match) throws IOException {
}
g.writeEndArray();
}
if (ruleIdToConfidence != null) {
Float confidence = ruleIdToConfidence.get(rule.getId());
if (confidence != null) {
g.writeNumberField("confidence", confidence);
}
}
g.writeEndObject();
}

Expand Down

0 comments on commit c077841

Please sign in to comment.