Skip to content

Commit

Permalink
Merge pull request #660 from PyThaiNLP/add-thai_w2p_v0.2
Browse files Browse the repository at this point in the history
Add Thai W2P v0.2 and PyThaiNLP v3.0.6dev0
  • Loading branch information
wannaphong committed Apr 12, 2022
2 parents b1a37ba + c3ea3ba commit 9588255
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pythainlp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "3.0.5"
__version__ = "3.0.6dev0"

thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars

Expand Down
4 changes: 2 additions & 2 deletions pythainlp/transliterate/w2p.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def __init__(self):
self.graphemes = hp.graphemes
self.phonemes = hp.phonemes
self.g2idx, self.idx2g, self.p2idx, self.idx2p = _load_vocab()
self.checkpoint = get_corpus_path(_MODEL_NAME, version="0.1")
self.checkpoint = get_corpus_path(_MODEL_NAME, version="0.2")
if self.checkpoint is None:
download(_MODEL_NAME, version="0.1")
download(_MODEL_NAME, version="0.2")
self.checkpoint = get_corpus_path(_MODEL_NAME)
self._load_variables()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

setup(
name="pythainlp",
version="3.0.5",
version="3.0.6dev0",
description="Thai Natural Language Processing library",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down
4 changes: 1 addition & 3 deletions tests/test_transliterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ def test_puan(self):
self.assertEqual(puan("แมว"), "แมว")
self.assertEqual(puan("นาริน"), "นิน-รา")
self.assertEqual(puan("นาริน", show_pronunciation=False), "นินรา")
self.assertEqual(puan("แสงดีนะ"), "แสง-ดะ-นี")
self.assertEqual(puan("แสงดีนะ", show_pronunciation=False), "แสงดะนี")
self.assertEqual(
puan("การทำความดี", show_pronunciation=False), "ดานทำความกี"
puan("การทำความดี", show_pronunciation=False), "ดานทำความกี"
)

0 comments on commit 9588255

Please sign in to comment.