Skip to content

Commit d25fe08

Browse files
authored
Update w2p.py
1 parent 0a0a371 commit d25fe08

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pythainlp/transliterate/w2p.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ def _grucell(self, x, h, w_ih, w_hh, b_ih, b_hh):
9898

9999
rz_ih, n_ih = (
100100
rzn_ih[:, : rzn_ih.shape[-1] * 2 // 3],
101-
rzn_ih[:, rzn_ih.shape[-1] * 2 // 3 :],
101+
rzn_ih[:, rzn_ih.shape[-1] * 2 // 3:],
102102
)
103103
rz_hh, n_hh = (
104104
rzn_hh[:, : rzn_hh.shape[-1] * 2 // 3],
105-
rzn_hh[:, rzn_hh.shape[-1] * 2 // 3 :],
105+
rzn_hh[:, rzn_hh.shape[-1] * 2 // 3:],
106106
)
107107

108108
rz = self._sigmoid(rz_ih + rz_hh)
@@ -196,5 +196,10 @@ def __call__(self, word: str) -> str:
196196

197197

198198
def pronunciate(text: str) -> str:
199+
"""
200+
Convert a Thai word to its pronunciation in Thai letters.
201+
202+
Input should be one single word.
203+
"""
199204
global _THAI_W2P
200205
return _THAI_W2P(text)

0 commit comments

Comments
 (0)