Skip to content

Commit

Permalink
Update DetectedLanguage.java
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Jan 16, 2024
1 parent 3f29a71 commit ee0a471
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ public static DetectedLanguage ofJSON(ObjectNode jsonNode) {
DetectedLanguage detected =
new DetectedLanguage(jsonNode.get("language").asText(), jsonNode.get("score").floatValue());

if (jsonNode.has("isTranslationSupported"))
if (jsonNode.has("isTranslationSupported")) {
detected.isTranslationSupported = jsonNode.get("isTranslationSupported").asBoolean();
if (jsonNode.has("isTransliterationSupported"))
}

if (jsonNode.has("isTransliterationSupported")) {
detected.isTransliterationSupported = jsonNode.get("isTransliterationSupported").asBoolean();
}

return detected;
}

Expand Down

0 comments on commit ee0a471

Please sign in to comment.