Skip to content
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

Merged
merged 20 commits into from
Oct 23, 2018
Merged

Clean code, remove Python 2 compatibility code #134

merged 20 commits into from
Oct 23, 2018

Conversation

bact
Copy link
Member

@bact bact commented Oct 23, 2018

  • 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
  • for import errors, raise ImportError instead of sys.exit()
  • .gitignore: ignore .idea folder (IDE)
  • remove .idea folder and other unused files (*.tool, etc.)
  • AppVeyor now tests with Python 3.4 (32-bit) and Python 3.6 (32-bit) new (can't add 3.7 and 64-bit, due to lack of PyICU wheels)

- 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
@coveralls
Copy link

coveralls commented Oct 23, 2018

Coverage Status

Coverage decreased (-0.6%) to 52.961% when pulling af1f081 on bact:dev into 476fd13 on PyThaiNLP:dev.

@wannaphong
Copy link
Member

โค้ดส่วน romanization กับ romanization_royin ทำการทดสอบแล้วไม่ผ่านครับ https://travis-ci.org/PyThaiNLP/pythainlp/jobs/444967011

self.assertEqual(romanize('แมว'), 'maeo')
self.assertEqual(romanize('แมว', 'pyicu'), 'mæw')
self.assertEqual(romanize("แมว"), "maeo")
self.assertEqual(romanize("แมว", "pyic"), "mæw")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

เปลี่ยน pyic เป็น pyicu

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ขอบคุณครับ

engine = "royin"
self.assertEqual(romanize("แมว", engine=engine), "maeo")
self.assertEqual(romanize("เดือน", engine=engine), "duean")
self.assertEqual(romanize("ดู", engine=engine), "d")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

เปลี่ยน d เป็น du ครับ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ขอบคุณครับ

@bact
Copy link
Member Author

bact commented Oct 23, 2018

โค้ดส่วน romanization กับ romanization_royin ทำการทดสอบแล้วไม่ผ่านครับ https://travis-ci.org/PyThaiNLP/pythainlp/jobs/444967011

แก้ไขเรียบร้อย build + test ผ่านแล้วครับ ขอบคุณครับ

@wannaphong wannaphong merged commit 0f5240b into PyThaiNLP:dev Oct 23, 2018
@wannaphong wannaphong added this to the 1.8 milestone Oct 23, 2018
@wannaphong wannaphong mentioned this pull request Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants