mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
Only checking 20 first words is usually enough
This commit is contained in:
committed by
Ebrahim Byagowi
parent
17288017d8
commit
d8537a98aa
@@ -41,6 +41,11 @@ class EstimateDirection {
|
|||||||
} else if (hasAnyLtr(token)) {
|
} else if (hasAnyLtr(token)) {
|
||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only checking 20 first words is usually enough
|
||||||
|
if (i == 20) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return total == 0 ? false : ((float) rtlCount / total > RTL_DETECTION_THRESHOLD ? true : false);
|
return total == 0 ? false : ((float) rtlCount / total > RTL_DETECTION_THRESHOLD ? true : false);
|
||||||
|
|||||||
Reference in New Issue
Block a user