File: test_hangul.py

package info (click to toggle)
libhangul 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,468 kB
  • sloc: ansic: 8,619; python: 631; xml: 402; makefile: 211; ruby: 26; sh: 14
file content (20 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from hangul import *
import sys

hic = hangul_ic_new("2")

for ascii in raw_input():
    ret = hangul_ic_process(hic, ord(ascii))
    commit = hangul_ic_get_commit_string(hic)
    if len(commit)>0:
        sys.stdout.write(commit)
    if not ret:
        sys.stdout.write(ascii)

if not hangul_ic_is_empty(hic):
    commit = hangul_ic_flush(hic)
    if len(commit)>0:
        sys.stdout.write(commit)

hangul_ic_delete(hic);
sys.stdout.write('\n')