VikParuchuri / surya

OCR, layout analysis, reading order, line detection in 90+ languages

Home Page:https://www.datalab.to

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overwrite of lang length guarantees assertion

Sciumo opened this issue · comments

        if isinstance(langs[0], str):
            langs = [langs]

guarantees a length of 1. ?!
Why did all_langs not get assigned langs?

assert len(langs) == len(texts)

Langs needs to look like:

[
["English", "Russian"],
["English"]
]

One list per input line.

If it looks like ["English", "Russian"], then we turn it into a list of lists.

Then that is that the assert should check.
It does not.

        if isinstance(langs[0], str):
            langs = [langs]

is guaranteed to fail

        assert len(langs) == len(texts)