Skip to content

Commit

Permalink
delete six.u
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Mar 31, 2017
1 parent a80f5e7 commit f025bb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions pythainlp/number/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
from builtins import dict
from builtins import int
import math,six
p = [['ภาษาไทย', 'ตัวเลข','เลขไทย'],
['หนึ่ง', '1', '๑'],
['สอง', '2', '๒'],
['สาม', '3', '๓'],
['สี่', '4', '๔'],
['ห้า', '5', '๕'],
['หก', '6', '๖'],
['หก', '7', '๗'],
['แปด', '8', '๘'],
['เก้า', '9', '๙']]
p = [[u'ภาษาไทย', u'ตัวเลข',u'เลขไทย'],
[u'หนึ่ง', u'1', u'๑'],
[u'สอง', u'2', u'๒'],
[u'สาม', u'3', u'๓'],
[u'สี่', u'4', u'๔'],
[u'ห้า', u'5', u'๕'],
[u'หก', u'6', u'๖'],
[u'หก', u'7', u'๗'],
[u'แปด', u'8', u'๘'],
[u'เก้า', u'9', u'๙']]
thaitonum = dict((x[2], x[1]) for x in p[1:])
p1 = dict((x[0], x[1]) for x in p[1:])
d1 = 0
Expand Down Expand Up @@ -71,7 +71,7 @@ def numtowords(amount_number):
ret += satang + "สตางค์"
else:
ret += "ถ้วน"
return six.u(ret)
return ret

#อ่านจำนวนตัวเลขภาษาไทย
def ReadNumber(number):
Expand Down
4 changes: 2 additions & 2 deletions pythainlp/segment/pyicu.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import,print_function,unicode_literals
from itertools import groupby
import PyICU,six
import PyICU
def segment(txt):
"""รับค่า ''str'' คืนค่าออกมาเป็น ''list'' ที่ได้มาจากการตัดคำโดย ICU"""
bd = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th"))
bd.setText(six.u(txt))
bd.setText(txt)
breaks = list(bd)
return [txt[x[0]:x[1]] for x in zip([0]+breaks, breaks)]
if __name__ == "__main__":
Expand Down

0 comments on commit f025bb3

Please sign in to comment.