Skip to content

Commit

Permalink
EA-3619 - remove sysouts
Browse files Browse the repository at this point in the history
  • Loading branch information
SrishtiSingh-eu committed Dec 1, 2023
1 parent 47a4bec commit 9a60628
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ public String getMostRepresentativeLanguage(FullBean bean, String targetLanguage
return null;
}

System.out.println("langCountMap "+langCountMap);
//reverse map - as values might not be unique so using grouping method
Map<Integer, List<String>> reverseMap =
langCountMap.entrySet()
.stream()
.collect(Collectors.groupingBy(Map.Entry::getValue, Collectors.mapping(Map.Entry::getKey, Collectors.toList())));
List<String> languagesWithMostvalues = reverseMap.get(Collections.max(reverseMap.keySet()));

System.out.println("reverseMap "+reverseMap);

// if there is a tie between more than one language, choose based on the precedance list
if (languagesWithMostvalues.size() > 1) {
Optional<String> langWithHigherPrecedance = PRECENDANCE_LIST.stream().filter(languagesWithMostvalues :: contains).findFirst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,7 @@ public TranslationApiRestClient(WebClient apiClient) {
* @return
*/
public TranslationResponse getTranslations(String request) {
TranslationResponse response = getTranslationApiResponse(webClient, TranslationClientUtils.buildUrl(TRANSLATE_URL), request, false);

System.out.println(response.getTranslations());
System.out.println(response.getLang());
System.out.println(response.getService());

return response;
return getTranslationApiResponse(webClient, TranslationClientUtils.buildUrl(TRANSLATE_URL), request, false);
}

/**
Expand All @@ -48,10 +42,7 @@ public TranslationResponse getTranslations(String request) {
* @return
*/
public LangDetectResponse getDetectedLanguages(String request) {
LangDetectResponse response = getTranslationApiResponse(webClient, TranslationClientUtils.buildUrl(LANG_DETECT_URL), request, true);
System.out.println(response.getLangs());
System.out.println(response.getService());
return response;
return getTranslationApiResponse(webClient, TranslationClientUtils.buildUrl(LANG_DETECT_URL), request, true);
}


Expand Down

0 comments on commit 9a60628

Please sign in to comment.