Skip to content

Commit

Permalink
Merge pull request #62 from europeana/EA-3842-exception-handling-and_…
Browse files Browse the repository at this point in the history
…logging

fix exceeds snippet limit condition
  • Loading branch information
gsergiu authored Jun 14, 2024
2 parents c2c5b9d + 172b12e commit 8f01961
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private void limitTextSizeForETranslation(TranslationRequest translationRequest,
}

private boolean exceedesSnippetLimit(StringBuilder translJointString, String textToAppend) {
return translJointString.length() + textToAppend.length() <= ETranslationTranslationService.ETRANSLATION_SNIPPET_LIMIT;
return translJointString.length() + textToAppend.length() >= ETranslationTranslationService.ETRANSLATION_SNIPPET_LIMIT;
}

private boolean shouldTruncateText(TranslationRequest translationRequest) {
Expand Down

0 comments on commit 8f01961

Please sign in to comment.