Skip to content

Commit d5bd30a

Browse files
committed
Add docs
1 parent b258ac7 commit d5bd30a

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

docs/api/corpus.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ Modules
2222
.. autofunction:: thai_family_names
2323
.. autofunction:: thai_female_names
2424
.. autofunction:: thai_male_names
25+
26+
ConceptNet
27+
----------
28+
29+
ConceptNet is an open, multilingual knowledge graph
30+
See: https://github.com/commonsense/conceptnet5/wiki/API
31+
2532
.. autofunction:: pythainlp.corpus.conceptnet.edges
2633

2734
TNC
@@ -34,7 +41,14 @@ TTC
3441

3542
.. autofunction:: pythainlp.corpus.ttc.word_freqs
3643

37-
Wordnet
44+
Util
45+
----
46+
47+
.. autofunction:: pythainlp.corpus.util.find_badwords
48+
.. autofunction:: pythainlp.corpus.util.revise_wordset
49+
.. autofunction:: pythainlp.corpus.util.revise_newmm_default_wordset
50+
51+
WordNet
3852
-------
3953

4054
PyThaiNLP API is an exact copy of NLTK WordNet API.

docs/api/summarize.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pythainlp.summarize
44
====================================
5-
The :class:`summarize` is thai text summarize.
5+
The :class:`summarize` is Thai text summarizer.
66

77
Modules
88
-------

docs/api/tag.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ Abbreviation Part-of-Speech tag Examples
4040
NLBL Label noun 1, 2, 3, 4, ก, ข, a, b
4141
NCMN Common noun หนังสือ, อาหาร, อาคาร, คน
4242
NTTL Title noun ครู, พลเอก
43-
PPRS Personal pronoun ‡ คุณ, เขา, ฉัน
44-
PDMN Demonstrative pronoun œ นี่, นั้น, ที่นั่น, ที่นี่
43+
PPRS Personal pronoun คุณ, เขา, ฉัน
44+
PDMN Demonstrative pronoun นี่, นั้น, ที่นั่น, ที่นี่
4545
PNTR Interrogative pronoun ใคร, อะไร, อย่างไร
46-
PREL Relative pronoun š ที่, ซึ่ง, อัน, ผู้
47-
VACT Active verb šÎµŠµœ, ทำงาน, ร้องเพลง, กิน
46+
PREL Relative pronoun ที่, ซึ่ง, อัน, ผู้
47+
VACT Active verb ทำงาน, ร้องเพลง, กิน
4848
VSTA Stative verb เห็น, รู้, คือ
4949
VATT Attributive verb อ้วน, ดี, สวย
5050
XVBM Pre-verb auxiliary, before negator "ไม่" เกิด, เกือบ, กำลัง
5151
XVAM Pre-verb auxiliary, after negator "ไม่" ค่อย, น่า, ได้
5252
XVMM Pre-verb, before or after negator "ไม่" ควร, เคย, ต้อง
5353
XVBB Pre-verb auxiliary, in imperative mood กรุณา, จง, เชิญ, อย่า, ห้าม
54-
XVAE Post-verb auxiliary Å ไป, มา, ขึ้น
54+
XVAE Post-verb auxiliary ไป, มา, ขึ้น
5555
DDAN | Definite determiner, after noun without ยี่, นั่น, โน่น, ทั้งหมด
5656
| classifier in between
5757
DDAC | Definite determiner, allowing classifier นี้, นั้น, โน้น, นู้น
@@ -76,12 +76,12 @@ Abbreviation Part-of-Speech tag Examples
7676
CLTV Collective classifier | คู่, กลุ่ม, ฝูง, เชิง, ทาง,
7777
| ด้าน, แบบ, รุ่น
7878
CMTR Measurement classifier กิโลกรัม, แก้ว, ชั่วโมง
79-
CFQC Frequency classifier ‡ ครั้ง, เที่ยว
79+
CFQC Frequency classifier ครั้ง, เที่ยว
8080
CVBL Verbal classifier ม้วน, มัด
8181
JCRG Coordinating conjunction และ, หรือ, แต่
82-
JCMP Comparative conjunction „ กว่า, เหมือนกับ, เท่ากับ
82+
JCMP Comparative conjunction กว่า, เหมือนกับ, เท่ากับ
8383
JSBR Subordinating conjunction เพราะว่า, เนื่องจาก ที่, แม้ว่า, ถ้า
84-
RPRE Preposition ‹ จาก, ละ, ของ, ใต้, บน
84+
RPRE Preposition จาก, ละ, ของ, ใต้, บน
8585
INT Interjection โอ้บ, โอ้, เออ, เอ๋, อ๋อ
8686
FIXN Nominal prefix **การ**\ ทำงาน, **ความ**\ สนุนสนาน
8787
FIXV Adverbial prefix **อย่าง**\ เร็ว

pythainlp/corpus/util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ def revise_newmm_default_wordset(
133133
"""
134134
orig_words = thai_words()
135135
trie = Trie(orig_words)
136-
tokenize = lambda text: newmm.segment(text, custom_dict=trie)
136+
137+
def tokenize(text):
138+
return newmm.segment(text, custom_dict=trie)
139+
137140
revised_words = revise_wordset(tokenize, orig_words, training_data)
138141
return revised_words

0 commit comments

Comments
 (0)