65 |
/* Rule 1 : dead consonant rule */ |
/* Rule 1 : dead consonant rule */ |
66 |
q = buf; |
q = buf; |
67 |
len1 = len - 1; |
len1 = len - 1; |
68 |
for(i=0;i<len;i++) { |
for (i = 0; i < len; i++) { |
69 |
cc = str[i]; |
cc = str[i]; |
70 |
if (is_consonant(cc) && i < len1 && str[i+1] == VIRAMA) { |
if (is_consonant(cc) && i < len1 && str[i+1] == VIRAMA) { |
71 |
*q++ = cc + DEAD_CONSONANT_OFFSET; |
*q++ = cc + DEAD_CONSONANT_OFFSET; |
77 |
|
|
78 |
/************ RA rules */ |
/************ RA rules */ |
79 |
/* XXX: rule 3, 4, 7 should be handled as ligatures */ |
/* XXX: rule 3, 4, 7 should be handled as ligatures */ |
80 |
for(i=0;i<len1;i++) { |
for (i = 0; i < len1; i++) { |
81 |
/* Rule 2 */ |
/* Rule 2 */ |
82 |
if (buf[i] == RA_DEAD && |
if (buf[i] == RA_DEAD && |
83 |
(is_ind_vowel(buf[i+1]) || is_consonant(buf[i+1]))) { |
(is_ind_vowel(buf[i+1]) || is_consonant(buf[i+1]))) { |
111 |
} |
} |
112 |
|
|
113 |
/* convert dead consonant to half consonants */ |
/* convert dead consonant to half consonants */ |
114 |
for(i=0;i<len1;i++) { |
for (i = 0; i < len1; i++) { |
115 |
if (is_dead_consonant(buf[i]) && |
if (is_dead_consonant(buf[i]) && |
116 |
(i == (len1 - 1) || |
(i == (len1 - 1) || |
117 |
buf[i+1] == ZERO_WIDTH_JOINER || |
buf[i+1] == ZERO_WIDTH_JOINER || |
123 |
|
|
124 |
/* output result and update ctog */ |
/* output result and update ctog */ |
125 |
j = 0; |
j = 0; |
126 |
for(i=0;i<len;i++) { |
for (i = 0; i < len; i++) { |
127 |
c = buf[i]; |
c = buf[i]; |
128 |
if (c != 0) { |
if (c != 0) { |
129 |
ctog[i] = j; |
ctog[i] = j; |