Skip to content

Commit ce5ede5

Browse files
committed
fixed some docs
1 parent bb9384b commit ce5ede5

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

pythainlp/util/thai.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@ def isthai(text: str, ignore_chars: str = ".") -> bool:
4848
:rtype: bool
4949
5050
:Example:
51+
::
5152
52-
from pythainlp.util import isthai
53+
from pythainlp.util import isthai
5354
54-
isthai("กาลเวลา")
55-
# output: True
55+
isthai("กาลเวลา")
56+
# output: True
5657
57-
isthai("กาลเวลา.")
58-
# output: True
58+
isthai("กาลเวลา.")
59+
# output: True
5960
60-
isthai("กาล-เวลา")
61-
# output: False
61+
isthai("กาล-เวลา")
62+
# output: False
6263
63-
isthai("กาล-เวลา +66", ignore_chars="01234567890+-.,")
64-
# output: True
64+
isthai("กาล-เวลา +66", ignore_chars="01234567890+-.,")
65+
# output: True
6566
6667
"""
6768
if not ignore_chars:
@@ -85,20 +86,21 @@ def countthai(text: str, ignore_chars: str = _DEFAULT_IGNORE_CHARS) -> float:
8586
:rtype: float
8687
8788
:Example:
89+
::
8890
89-
from pythainlp.util import countthai
91+
from pythainlp.util import countthai
9092
91-
countthai("ไทยเอ็นแอลพี 2.3")
92-
# output: 100.0
93+
countthai("ไทยเอ็นแอลพี 2.3")
94+
# output: 100.0
9395
94-
countthai("PyThaiNLP 2.3")
95-
# output: 0.0
96+
countthai("PyThaiNLP 2.3")
97+
# output: 0.0
9698
97-
countthai("ใช้งาน PyThaiNLP 2.3")
98-
# output: 40.0
99+
countthai("ใช้งาน PyThaiNLP 2.3")
100+
# output: 40.0
99101
100-
countthai("ใช้งาน PyThaiNLP 2.3", ignore_chars="")
101-
# output: 30.0
102+
countthai("ใช้งาน PyThaiNLP 2.3", ignore_chars="")
103+
# output: 30.0
102104
"""
103105
if not text or not isinstance(text, str):
104106
return 0.0
@@ -133,9 +135,12 @@ def display_thai_char(ch: str) -> str:
133135
:rtype: str
134136
135137
:Example:
138+
::
139+
140+
from pythainlp.util import display_thai_char
136141
137-
display_thai_char("้")
138-
# output: "_้"
142+
display_thai_char("้")
143+
# output: "_้"
139144
"""
140145

141146
if (

pythainlp/util/time.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def time_to_thaiword(
172172
:rtype: str
173173
174174
:Example:
175+
::
175176
176177
time_to_thaiword("8:17")
177178
# output:
@@ -255,6 +256,7 @@ def thaiword_to_time(text: str, padding: bool = True) -> str:
255256
:rtype: str
256257
257258
:Example:
259+
::
258260
259261
thaiword_to_time"บ่ายโมงครึ่ง")
260262
# output:

0 commit comments

Comments
 (0)