-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean code, remove Python 2 compatibility code #134
Conversation
- fix English->Thai keyboard pairs "\\": "ฃ" (used to be "]": "ฃ") in change.py - remove six dependency in code and in requirements.txt - remove from __future__ import *, from builtins import * - change codecs.open() to open(), remove import codecs - change u"..." to "..." strings - make consistent indentations - small docs addition - add __ prefix to private members of class - rename class thainer() to ThaiNameRecognizer() (CamelCase class name) - adjust some example cases, make them more concise
- replace u"..." with "..." strings
โค้ดส่วน romanization กับ romanization_royin ทำการทดสอบแล้วไม่ผ่านครับ https://travis-ci.org/PyThaiNLP/pythainlp/jobs/444967011 |
tests/__init__.py
Outdated
self.assertEqual(romanize('แมว'), 'maeo') | ||
self.assertEqual(romanize('แมว', 'pyicu'), 'mæw') | ||
self.assertEqual(romanize("แมว"), "maeo") | ||
self.assertEqual(romanize("แมว", "pyic"), "mæw") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
เปลี่ยน pyic เป็น pyicu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ขอบคุณครับ
tests/__init__.py
Outdated
engine = "royin" | ||
self.assertEqual(romanize("แมว", engine=engine), "maeo") | ||
self.assertEqual(romanize("เดือน", engine=engine), "duean") | ||
self.assertEqual(romanize("ดู", engine=engine), "d") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
เปลี่ยน d เป็น du ครับ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ขอบคุณครับ
แก้ไขเรียบร้อย build + test ผ่านแล้วครับ ขอบคุณครับ |
"\\": "ฃ"
(used to be"]": "ฃ"
) in change.pysix
dependency in code and in requirements.txtfrom __future__ import *
,from builtins import *
codecs.open()
toopen()
, removeimport codecs
u"..."
to"..."
strings__
prefix to private members of classthainer()
toThaiNameRecognizer()
(CamelCase class name)ImportError
instead of sys.exit().idea
folder (IDE).idea
folder and other unused files (*.tool, etc.)