[TextExtractor]Check for CJK Language before combining OCR result to string (#20415)

This commit is contained in:
Joseph Finney
2022-09-09 10:18:40 -05:00
committed by GitHub
parent f19ba94a2c
commit 03cf77723e

View File

@@ -137,9 +137,24 @@ internal class ImageMethods
if (singlePoint == null) if (singlePoint == null)
{ {
foreach (OcrLine line in ocrResult.Lines) if (isCJKLang == false)
{ {
text.AppendLine(line.Text); foreach (OcrLine line in ocrResult.Lines)
{
text.AppendLine(line.Text);
}
}
else
{
foreach (OcrLine ocrLine in ocrResult.Lines)
{
foreach (OcrWord ocrWord in ocrLine.Words)
{
_ = text.Append(ocrWord.Text);
}
text.Append(Environment.NewLine);
}
} }
} }
else else