forked from Teekam/Digitisation-of-Scanned-Texts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lichange.m
40 lines (25 loc) · 860 Bytes
/
lichange.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function str=lichange(str,BB)
len=numel(str{1});
tot=0;
maxi=max(BB(:,4));
for i=1:len;
len2= numel(str{1}{i});
if len2==1
pos=1;
if str{1}{i}(pos)=='l'||str{1}{i}(pos)=='i'||str{1}{i}(pos)=='1'||str{1}{i}(pos)=='I'
str{1}{i}(pos)='I';
end
end
if(len2~=1)
for pos=1:len2,
if str{1}{i}(pos)=='i'||str{1}{i}(pos)=='l'||str{1}{i}(pos)=='I'||str{1}{i}(pos)=='1'
if BB(tot+pos,4)<=.7*maxi
str{1}{i}(pos)='i';
else
str{1}{i}(pos)='l';
end
end
end
end
tot=tot+len2;
end