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 Thai Solar Date convert to Thai Lunar Date #998

Merged
merged 11 commits into from
Nov 15, 2024
10 changes: 10 additions & 0 deletions docs/api/util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,16 @@ Modules

The `pythainlp.util.spell_words.spell_word` function is designed for spelling individual words in Thai text, facilitating phonetic analysis and pronunciation guides.

.. autofunction:: to_lunar_date
:noindex:

The `to_lunar_date` function focuses on converts the solar date to Thai Lunar Date.

.. autofunction:: th_zodiac
:noindex:

The `th_zodiac` function is converts a Gregorian year to its corresponding Thai Zodiac name.

.. autoclass:: Trie
:members:

Expand Down
7 changes: 6 additions & 1 deletion pythainlp/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"text_to_arabic_digit",
"text_to_num",
"text_to_thai_digit",
"th_zodiac",
"thai_digit_to_arabic_digit",
"thai_keyboard_dist",
"thai_strptime",
Expand All @@ -60,6 +61,7 @@
"time_to_thaiword",
"tis620_to_utf8",
"to_idna",
"to_lunar_date",
"tone_detector",
"words_to_num",
]
Expand Down Expand Up @@ -114,12 +116,15 @@
isthaichar,
thai_word_tone_detector,
)
from pythainlp.util.thai_lunar_date import th_zodiac, to_lunar_date
from pythainlp.util.thaiwordcheck import is_native_thai
from pythainlp.util.time import thaiword_to_time, time_to_thaiword
from pythainlp.util.trie import Trie, dict_trie
from pythainlp.util.wordtonum import text_to_num, thaiword_to_num, words_to_num

# sound_syllable and pronounce have to be imported last
# sound_syllable and pronounce have to be imported last,
# to prevent circular import issues.
# Other imports should be above this line, sorted.
from pythainlp.util.syllable import (
sound_syllable,
syllable_length,
Expand Down
Loading
Loading