fix: Correct logical condition for better OCR candidate selection
This commit is contained in:
@@ -987,8 +987,8 @@
|
|||||||
const reasons = getOcrPhiReasons(text);
|
const reasons = getOcrPhiReasons(text);
|
||||||
|
|
||||||
const isBetter = reasons.length > bestReasons.length
|
const isBetter = reasons.length > bestReasons.length
|
||||||
|| (reasons.length === bestReasons.length && text.length > bestText.length)
|
|| (reasons.length === bestReasons.length && text.length > bestText.length)
|
||||||
|| (reasons.length === bestReasons.length && text.length === bestText.length && confidence > bestConfidence);
|
|| (reasons.length === bestReasons.length && text.length === bestText.length && confidence > bestConfidence);
|
||||||
|
|
||||||
if (isBetter) {
|
if (isBetter) {
|
||||||
bestText = text;
|
bestText = text;
|
||||||
|
|||||||
Reference in New Issue
Block a user