Skip to content

Commit dee25d3

Browse files
committed
Update docs
1 parent 5b5696a commit dee25d3

File tree

7 files changed

+12
-56
lines changed

7 files changed

+12
-56
lines changed

docs/api/tokenize.rst

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,17 @@ crfcut
2727
------
2828
.. automodule:: pythainlp.tokenize.crfcut
2929

30-
.. autofunction:: pythainlp.tokenize.crfcut.extract_features
31-
.. autofunction:: pythainlp.tokenize.crfcut.segment
32-
3330
thaisumcut
3431
----------
3532
.. automodule:: pythainlp.tokenize.thaisumcut
3633

37-
.. autofunction:: pythainlp.tokenize.thaisumcut.list_to_string
38-
.. autofunction:: pythainlp.tokenize.thaisumcut.middle_cut
39-
.. autoclass:: pythainlp.tokenize.thaisumcut.ThaiSentenceSegmentor
40-
:members:
41-
4234
Word level
4335
----------
4436

4537
attacut
4638
+++++++
4739
.. automodule:: pythainlp.tokenize.attacut
4840

49-
.. autoclass:: pythainlp.tokenize.attacut.AttacutTokenizer
50-
:members:
51-
5241
deepcut
5342
+++++++
5443
.. automodule:: pythainlp.tokenize.deepcut
@@ -57,22 +46,14 @@ multi_cut
5746
+++++++++
5847
.. automodule:: pythainlp.tokenize.multi_cut
5948

60-
.. autofunction:: pythainlp.tokenize.multi_cut.segment
61-
.. autofunction:: pythainlp.tokenize.multi_cut.find_all_segment
62-
6349
nlpo3
6450
+++++
6551
.. automodule:: pythainlp.tokenize.nlpo3
6652

67-
.. autofunction:: pythainlp.tokenize.nlpo3.load_dict
68-
.. autofunction:: pythainlp.tokenize.nlpo3.segment
69-
7053
longest
7154
+++++++
7255
.. automodule:: pythainlp.tokenize.longest
7356

74-
.. autofunction:: pythainlp.tokenize.longest.segment
75-
7657
pyicu
7758
+++++
7859
.. automodule:: pythainlp.tokenize.pyicu
@@ -81,8 +62,6 @@ nercut
8162
++++++
8263
.. automodule:: pythainlp.tokenize.nercut
8364

84-
.. autofunction:: pythainlp.tokenize.nercut.segment
85-
8665
sefr_cut
8766
++++++++
8867
.. automodule:: pythainlp.tokenize.sefr_cut
@@ -98,7 +77,6 @@ The default word tokenization engine.
9877

9978
.. automodule:: pythainlp.tokenize.newmm
10079

101-
.. autofunction:: pythainlp.tokenize.newmm.segment
10280

10381
Subword level
10482
-------------
@@ -107,20 +85,10 @@ tcc
10785
+++
10886
.. automodule:: pythainlp.tokenize.tcc
10987

110-
.. autofunction:: pythainlp.tokenize.tcc.segment
111-
.. autofunction:: pythainlp.tokenize.tcc.tcc
112-
.. autofunction:: pythainlp.tokenize.tcc.tcc_pos
113-
11488
tcc+
11589
+++
11690
.. automodule:: pythainlp.tokenize.tcc_p
11791

118-
.. autofunction:: pythainlp.tokenize.tcc_p.segment
119-
.. autofunction:: pythainlp.tokenize.tcc_p.tcc
120-
.. autofunction:: pythainlp.tokenize.tcc_p.tcc_pos
121-
12292
etcc
12393
++++
12494
.. automodule:: pythainlp.tokenize.etcc
125-
126-
.. autofunction:: pythainlp.tokenize.etcc.segment

pythainlp/cls/param_free.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def predict(self, x1: str, k: int = 1) -> str:
4848
::
4949
5050
from pythainlp.cls import GzipModel
51-
51+
5252
training_data = [
5353
("รายละเอียดตามนี้เลยค่าา ^^", "Neutral"),
5454
("กลัวพวกมึงหาย อดกินบาบิก้อน", "Neutral"),

pythainlp/khavee/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ def check_klon(self, text: str,k_type: int=8) -> Union[List[str], str]:
418418
def check_aek_too(self, text: Union[List[str], str], dead_syllable_as_aek:bool = False) -> Union[List[bool], List[str], bool, str]:
419419
"""
420420
Thai tonal word checker
421+
421422
:param Union[List[str], str] text: Thai word or list of Thai words
422423
:param bool dead_syllable_as_aek: if True, dead syllable will be considered as aek
423424
:return: the check if the word is aek or too or False(not both) or list of the check if input is list

pythainlp/tokenize/core.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def clause_tokenize(doc: List[str]) -> List[List[str]]:
4444
:return: list of claues
4545
:rtype: list[list[str]]
4646
:Example:
47-
Clause tokenizer::
47+
::
48+
4849
from pythainlp.tokenize import clause_tokenize
4950
clause_tokenize(["ฉัน","นอน","และ","คุณ","เล่น","มือถือ","ส่วน","น้อง","เขียน","โปรแกรม"])
5051
# [['ฉัน', 'นอน'],
@@ -68,6 +69,12 @@ def word_detokenize(
6869
:param str output: the output type (str or list)
6970
:return: the thai text
7071
:rtype: Union[str,List[str]]
72+
:Example:
73+
::
74+
75+
from pythainlp.tokenize import word_detokenize
76+
print(word_detokenize(["เรา", "เล่น"]))
77+
# output: เราเล่น
7178
"""
7279
_list_all = []
7380
if isinstance(segments[0], str):

pythainlp/tokenize/etcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def segment(text: str) -> List[str]:
6868
6969
:param str text: text to be tokenized to character clusters
7070
:return: list of clusters, tokenized from the text
71-
:return: list[str]
71+
:return: List[str]
7272
"""
7373

7474
if not text or not isinstance(text, str):

pythainlp/translate/core.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,6 @@
1717
class Translate:
1818
"""
1919
Machine Translation
20-
21-
:param str src_lang: source language
22-
:param str target_lang: target language
23-
:param bool use_gpu: load model to gpu (Default is False)
24-
25-
**Options for source & target language**
26-
* *th* - *en* - Thai to English
27-
* *en* - *th* - English to Thai
28-
* *th* - *zh* - Thai to Chinese
29-
* *zh* - *th* - Chinese to Thai
30-
* *th* - *fr* - Thai to French
31-
32-
:Example:
33-
34-
Translate text from Thai to English::
35-
36-
from pythainlp.translate import Translate
37-
th2en = Translate('th', 'en')
38-
39-
th2en.translate("ฉันรักแมว")
40-
# output: I love cat.
4120
"""
4221

4322
def __init__(

pythainlp/transliterate/wunsen.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def transliterate(
8787
8888
:Example:
8989
::
90+
9091
from pythainlp.transliterate.wunsen import WunsenTransliterate
9192
9293
wt = WunsenTransliterate()

0 commit comments

Comments
 (0)