From 7a143635e44541009f0e2fb95c6484e9b7986431 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 21 Jan 2021 22:28:42 +0100 Subject: [PATCH] Language detected at 80% --- app/src/main/java/eu/faircode/email/TextHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/TextHelper.java b/app/src/main/java/eu/faircode/email/TextHelper.java index 712012371c..3058e238bd 100644 --- a/app/src/main/java/eu/faircode/email/TextHelper.java +++ b/app/src/main/java/eu/faircode/email/TextHelper.java @@ -41,6 +41,7 @@ import java.util.Set; public class TextHelper { private static final int MAX_SAMPLE_SIZE = 8192; + private static final float MIN_PROBABILITY = 0.80f; static { System.loadLibrary("fairemail"); @@ -68,7 +69,7 @@ public class TextHelper { DetectResult result = jni_detect_language(sample); Log.i("Language=" + result); - if (result.probability < 0.5) + if (result.probability < MIN_PROBABILITY) return null; try {