Skip to content

Commit

Permalink
Resolve 'wa' conversion trouble #42
Browse files Browse the repository at this point in the history
It fixes am_push by adding missing conditions into Choseong/Jungseong eatting step.
  • Loading branch information
onting committed Nov 23, 2021
1 parent a3e73ab commit 6f5e33c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions hanjpautomata.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ hanjp_am_base_to_kana(HanjpAutomata *am, GArray *dest, HanjpBuffer *buffer)
}

//eat Choseong and Jungseong
while(buffer->cho || buffer->jung) {
while(buffer->cho || buffer->jung || buffer->jung2) {
adj = 0;
ch = buffer->cho; // victim
buffer->cho = 0;
Expand Down Expand Up @@ -285,8 +285,8 @@ hanjp_am_base_to_kana(HanjpAutomata *am, GArray *dest, HanjpBuffer *buffer)
return -1;
}

// reduce jung
ch = buffer->jung2;
// Reduce Jungseong to single character
ch = buffer->jung2; // victim
buffer->jung2 = 0;
if(buffer->jung == 0) {
buffer->jung = ch;
Expand All @@ -303,9 +303,8 @@ hanjp_am_base_to_kana(HanjpAutomata *am, GArray *dest, HanjpBuffer *buffer)
}
}

// divide jungseong
ch = buffer->jung;
switch(ch) {
// Divide Jungseong into eatable
switch(buffer->jung) {
case HANJP_JUNGSEONG_WA:
if(i == HANJP_CONSONANT__) {
i = HANJP_CONSONANT_W;
Expand Down Expand Up @@ -335,7 +334,7 @@ hanjp_am_base_to_kana(HanjpAutomata *am, GArray *dest, HanjpBuffer *buffer)
}

//select column index
ch = buffer->jung;
ch = buffer->jung; // victim
buffer->jung = 0;
switch(ch) {
case HANJP_JUNGSEONG_WA:
Expand Down

0 comments on commit 6f5e33c

Please sign in to comment.