-
Notifications
You must be signed in to change notification settings - Fork 0
/
part_of_the_character_finder.m
34 lines (26 loc) · 1.04 KB
/
part_of_the_character_finder.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
%================================================================================%
%Note: %
%This is a subfunction from the the Baybayin and Latin Script Recognition System % %
%(Baybayin_identifier.m) for determining the components of a Baybayin or Latin %
%character which will further hints us the true number of %
%characters from the input Baybayin and/or Latin word. %
%--------------------------------------------------------------------------------%
%X=predetermined abscissa locations (zero represents it is a part of the preceding component)
function K=part_of_the_character_finder(X)
Kn=nnz(X);
K=cell(Kn,1);
Finder=find(X);
for i=1:Kn
if i==Kn
K{i}=zeros(1,length(X)+1-Finder(Kn));
C=K{i};
C(1)=X(Finder(i));
K{i}=C;
break;
end
K{i}=zeros(1,Finder(i+1)-Finder(i));
C=K{i};
C(1)=X(Finder(i));
K{i}=C;
end
end