forked from Archives/Athou_commafeed
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)) {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user