Language detected at 80%

This commit is contained in:
M66B 2021-01-21 22:28:42 +01:00
parent d5f5ce3649
commit 7a143635e4
1 changed files with 2 additions and 1 deletions

View File

@ -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 {