@@ -210,17 +210,15 @@ impl Encoder {
210210 // 8항 - 단독으로 쓰인 자모
211211 result. push ( 63 ) ;
212212 result. extend ( korean_part:: encode_korean_part ( c) ?) ;
213+ } else if has_korean_char {
214+ // 10항 - 단독으로 쓰인 자음자가 단어에 붙어 나올 때
215+ result. push ( 56 ) ;
216+ result. extend ( korean_part:: encode_korean_part ( c) ?) ;
213217 } else {
214- if has_korean_char {
215- // 10항 - 단독으로 쓰인 자음자가 단어에 붙어 나올 때
216- result. push ( 56 ) ;
217- result. extend ( korean_part:: encode_korean_part ( c) ?) ;
218- } else {
219- // 10항 - 단독으로 쓰인 자음자가 단어에 붙어 나올 때
220- // 8항 - 단독으로 쓰인 자모
221- result. push ( 63 ) ;
222- result. extend ( korean_part:: encode_korean_part ( c) ?) ;
223- }
218+ // 10항 - 단독으로 쓰인 자음자가 단어에 붙어 나올 때
219+ // 8항 - 단독으로 쓰인 자모
220+ result. push ( 63 ) ;
221+ result. extend ( korean_part:: encode_korean_part ( c) ?) ;
224222 }
225223 }
226224 }
@@ -337,8 +335,8 @@ impl Encoder {
337335 }
338336 }
339337
340- if self . triple_big_english {
341- if !( remaining_words
338+ if self . triple_big_english
339+ && !( remaining_words
342340 . first ( )
343341 . is_some_and ( |w| w. chars ( ) . all ( |c| c. is_ascii_alphabetic ( ) ) ) )
344342 {
@@ -349,7 +347,6 @@ impl Encoder {
349347 result. push ( 4 ) ;
350348 self . triple_big_english = false ; // Reset after adding terminator
351349 }
352- }
353350 if !remaining_words. is_empty ( ) {
354351 if self . english_indicator
355352 && !remaining_words[ 0 ]
@@ -590,7 +587,8 @@ mod test {
590587 for ( line_num, result) in reader. into_records ( ) . enumerate ( ) {
591588 total += 1 ;
592589 file_total += 1 ;
593- let record = result. unwrap ( ) ;
590+ let error = format ! ( "CSV 레코드를 읽는 중 오류 발생: {:?} at {}" , result, line_num) ;
591+ let record = result. expect ( & error) ;
594592 let input = & record[ 0 ] ;
595593 let expected = record[ 2 ] . replace ( " " , "⠀" ) ;
596594 match encode ( input) {
0 commit comments