-
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
Consistent naming and consolidate similar codes #146
Conversation
- consolidate dictionary reading codes into fewer files (shared get_corpus() code) - make dictionary filenames more consistent to each other (see #141) - old new-thaidict.txt is now words_th.txt (will use as the most updated word list) - old thaiword.txt and thaiword_frozen_201810.txt is now words_th_frozen_201810.txt (can have more versions in the future) - pythainlp.corpus.alphabets, tone, etc becomes pythainlp.corpus.THAI_ALPHABETS, THAI_TONEMARKS, etc. and now in a ```str``` form, which in this use case (1-char members) can iterate faster that list or set (follow the design of ```ascii_letters```, etc. in ```string``` module) - rename pythainlp/tag/old.py -> pythainlp/tag/unigram.py
- remove redundant code creating new dict trie in tokenize/__init__.py
1 similar comment
- more test cases
ผมพยายามรวมโค้ดที่ซ้ำเข้าด้วยกัน ซึ่งบางอันจะทำให้ชื่อการใช้เข้าถึงเปลี่ยนไป (ชื่อ API จะเปลี่ยน) ถ้ามีตรงไหนเปลี่ยนแล้วไม่สมเหตุผล สามารถแก้ไขได้ครับ |
…wercase), as suggested by @wannaphongcom - move them from pythainlp.corpus module to to pythainlp module since they are not really a corpus and are common variables to be shared by all modules
…/__init__.py - reduce numbers of convenience imports in pythainlp/__init__.py to reduce namespace crashes/mutual top-level import crashes possibility
- Move isthai() function from pythainlp.tokenize to pythainlp.util - Move wordtonum function from pythainlp.util to pythainlp.number - Refactor codes related to pythainlp.util - More test cases, sort test cases by import order
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.
ชื่อประเทศในรายการ ให้ใส่วงเล็บภาษาไทย/ภาษาอังกฤษเข้าไปด้วยไหมครับ
เรื่องวงเล็บชื่อประเทศ ขอแยกไปเป็นอีกรอบครับ มีหลายประเทศเลย ที่มีวงเล็บ ท้ังวงเล็บไทยและวงเล็บอังกฤษ |
Naming
Reduce redundant codes
Common characters set
str
form, which in this use case (1-char members) can iterate faster that list or set (follow the design ofascii_letters
, etc. instring
module)Test cases