[KoCo-CVS] [Commit] KoreanCodecs/korean/python hangul.py
Brought to you by:
perky
From: Chang <pe...@us...> - 2002-04-25 05:01:10
|
perky 02/04/24 22:01:06 Modified: korean/python hangul.py Log: - Remove hangul.dividestring method (it was just fancy feature..) - Add c.hangul to distutil build chain. Yeah~ Revision Changes Path 1.5 +1 -30 KoreanCodecs/korean/python/hangul.py Index: hangul.py =================================================================== RCS file: /cvsroot/koco/KoreanCodecs/korean/python/hangul.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- hangul.py 25 Apr 2002 03:46:34 -0000 1.4 +++ hangul.py 25 Apr 2002 05:01:06 -0000 1.5 @@ -15,7 +15,7 @@ # Conjoining Jamo Behavior: # http://www.unicode.org/unicode/uni2book/ch03.pdf (section 3.11) # -# $Id: hangul.py,v 1.4 2002/04/25 03:46:34 perky Exp $ +# $Id: hangul.py,v 1.5 2002/04/25 05:01:06 perky Exp $ # class UnicodeHangulError(Exception): @@ -203,24 +203,6 @@ obuff.append(c) return u''.join(obuff) -def dividestring(str, intoelements=0): - r = u'' - for char in str: - if ishangul(char): - elems = split(char) - for elem in elems: - for htype in (Jaeum, Moeum, None): - if htype == None: - r += elem - elif intoelements and \ - htype.MultiElement.has_key(elem): - r += u''.join(htype.MultiElement[elem]) - break - else: - r += char - - return r - def _has_final(c): # for internal use only if u'\uac00' <= c <= u'\ud7a3': # hangul @@ -287,15 +269,4 @@ ncur += 1 return u''.join(obuff) - - -if __name__ == '__main__': - - print ( join([Jaeum.P, Moeum.EO, Null]) + \ - join([Jaeum.K, Moeum.I, Null]) + \ - join([Jaeum.JJ, Moeum.A, Jaeum.NG]) ).encode("utf-8") - - while 1: - code = raw_input(">>> ") - print dividestring(unicode(code, "utf-8"), 1).encode("utf-8") |