I have the following task:
string A: well known, can contains 0
, O
, i
, I
, 1
for sure - lets say a kind of article number.
string B: a string coming from an OCR. So some of the "0
"s can here also be a "O
", some "1
"s can be a "l
". The string has length of about 300 (just to get a feeling)
Now, I would like to know, if the OCR text contains my article number. So in princible, I have to check the OCR as it is at first. When not found, I will replace a first "O
" by a "0
" and try again. Now I have to try all combinations.
My idea was to define some arrays containing which letter can have similar letters:
[
["i", "l", "j", "1"],
["0", "o"],
[".", "*"]
]
To reduce the array size (and therefore the amount of possible combinations) I will put everything in lower case.
Now, the hard work starts. Do you know a smart way to walk through the combinations?
Thank you very much in advanced for your help!