Skip to content

Commit

Permalink
Merge pull request #998 from PyThaiNLP/add-thai-lunar-date
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong authored Nov 15, 2024
2 parents 0beba80 + 99df362 commit c5de73c
Show file tree
Hide file tree
Showing 4 changed files with 996 additions and 2 deletions.
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

0 comments on commit c5de73c

Please sign in to comment.