Consistent naming and consolidate similar codes#146
Merged
bact merged 20 commits intoPyThaiNLP:devfrom Nov 4, 2018
bact:dev
Merged
Consistent naming and consolidate similar codes#146bact merged 20 commits intoPyThaiNLP:devfrom bact:dev
bact merged 20 commits intoPyThaiNLP:devfrom
bact:dev
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
wannaphong
reviewed
Nov 2, 2018
Member
Author
|
ผมพยายามรวมโค้ดที่ซ้ำเข้าด้วยกัน ซึ่งบางอันจะทำให้ชื่อการใช้เข้าถึงเปลี่ยนไป (ชื่อ 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
wannaphong
reviewed
Nov 3, 2018
wannaphong
approved these changes
Nov 3, 2018
bact
commented
Nov 3, 2018
Member
Author
bact
left a comment
There was a problem hiding this comment.
ชื่อประเทศในรายการ ให้ใส่วงเล็บภาษาไทย/ภาษาอังกฤษเข้าไปด้วยไหมครับ
Member
Author
|
เรื่องวงเล็บชื่อประเทศ ขอแยกไปเป็นอีกรอบครับ มีหลายประเทศเลย ที่มีวงเล็บ ท้ังวงเล็บไทยและวงเล็บอังกฤษ |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Naming
Reduce redundant codes
Common characters set
strform, which in this use case (1-char members) can iterate faster that list or set (follow the design ofascii_letters, etc. instringmodule)Test cases