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

Add pythainlp.util.thai_time #303

Merged
merged 25 commits into from
Oct 17, 2019
Merged

Add pythainlp.util.thai_time #303

merged 25 commits into from
Oct 17, 2019

Conversation

wannaphong
Copy link
Member

@wannaphong wannaphong commented Oct 13, 2019

Add Thai Time to PyThaiNLP

Get time/datetime object or string of time and return time spell out in Thai words.

def thai_time(
    time_data: Union[time, datetime, str],
    fmt: str = "24h",
    precision: Union[str, None] = None,
) -> str:
...

@pep8speaks
Copy link

pep8speaks commented Oct 13, 2019

Hello @wannaphongcom! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 128:80: E501 line too long (81 > 79 characters)

Line 166:80: E501 line too long (100 > 79 characters)
Line 182:80: E501 line too long (80 > 79 characters)

Comment last updated at 2019-10-17 07:56:16 UTC

@wannaphong
Copy link
Member Author

@coveralls
Copy link

coveralls commented Oct 13, 2019

Coverage Status

Coverage increased (+0.4%) to 90.257% when pulling c1d4750 on thai_time into 5bcda6c on dev.

@bact
Copy link
Member

bact commented Oct 14, 2019

I convert the original class version to a version with normal function.

ผมแปลงโค้ดตั้งต้นที่เป็น class ให้เป็น function ธรรมดานะครับ
กรณีนี้คิดว่าใช้ class น่าจะเกินจำเป็นไปหน่อย

@wannaphong
Copy link
Member Author

@bact โอเคครับ ผมไม่แน่ใจว่าเราควรเพิ่มวินาทีลงไปด้วยดีไหมครับ

@bact bact added the enhancement enhance functionalities label Oct 15, 2019
Copy link
Contributor

@abhabongse abhabongse left a comment

Choose a reason for hiding this comment

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

ขออนุญาต comment เพิ่มเติมตามนี้นะครับ

pythainlp/util/thai_time.py Show resolved Hide resolved
pythainlp/util/thai_time.py Outdated Show resolved Hide resolved
pythainlp/util/thai_time.py Show resolved Hide resolved
@bact bact added this to the 2.1 milestone Oct 17, 2019
@bact
Copy link
Member

bact commented Oct 17, 2019

Will merge to dev for now. Can still change until the final release of 2.1

@bact bact merged commit ed46d65 into dev Oct 17, 2019
@bact bact deleted the thai_time branch October 20, 2019 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enhance functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants