[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

@@ -136,6 +136,8 @@ internal class ImageMethods
OcrResult ocrResult = await ocrEngine.RecognizeAsync(softwareBmp);
if (singlePoint == null)
{
if (isCJKLang == false)
{
foreach (OcrLine line in ocrResult.Lines)
{
@@ -143,6 +145,19 @@ internal class ImageMethods
}
}
else
{
foreach (OcrLine ocrLine in ocrResult.Lines)
{
foreach (OcrWord ocrWord in ocrLine.Words)
{
_ = text.Append(ocrWord.Text);
}
text.Append(Environment.NewLine);
}
}
}
else
{
Windows.Foundation.Point fPoint = new Windows.Foundation.Point(singlePoint.Value.X, singlePoint.Value.Y);
foreach (OcrLine ocrLine in ocrResult.Lines)