diff --git a/translation-service-apache-tika/src/main/java/eu/europeana/translation/service/apachetika/ApacheTikaLangDetectService.java b/translation-service-apache-tika/src/main/java/eu/europeana/translation/service/apachetika/ApacheTikaLangDetectService.java index a368b3d2..8c47601f 100644 --- a/translation-service-apache-tika/src/main/java/eu/europeana/translation/service/apachetika/ApacheTikaLangDetectService.java +++ b/translation-service-apache-tika/src/main/java/eu/europeana/translation/service/apachetika/ApacheTikaLangDetectService.java @@ -38,6 +38,20 @@ public List detectLang(List texts, String langHint) throws Langu if (texts.isEmpty()) { return new ArrayList<>(); } + + /* + * this code can be used for testing the lang hint, but the setPriors map cannot be sent empty or null + */ +// try { +// Map languageProbabilities = new HashMap(); +// if(! StringUtils.isBlank(langHint)) { +// languageProbabilities.put(langHint, (float) 1.0); +// } +// this.detector.setPriors(languageProbabilities); +// } catch (IOException e) { +// throw new LanguageDetectionException( +// "Invalid setting of the language hint for the Apache-Tika service!", -1, e); +// } List detectedLangs = new ArrayList(); for(String text : texts) {