Skip to content

Commit df24fe7

Browse files
committed
add docs : keywords,metasound
1 parent 2f16b90 commit df24fe7

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

pythainlp/MetaSound.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@
1111
import re
1212
def MetaSound(name):
1313
'''
14-
MetaSound(str) ภาษาไทย
15-
16-
>>> MetaSound('รัก')
17-
'501'
18-
>>> MetaSound('ลัก')
19-
'501'
14+
Thai MetaSound
2015
16+
:param str name: thai text
17+
:return: MetaSound for thai text
2118
'''
2219
name1=list(name)
2320
count=len(name1)
@@ -58,4 +55,4 @@ def MetaSound(name):
5855
return ''.join(name1)
5956
if __name__ == '__main__':
6057
print(MetaSound('รัก'))
61-
print(MetaSound('ลัก'))
58+
print(MetaSound('ลัก'))

pythainlp/keywords/__init__.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
from pythainlp.rank import rank
55
def find_keyword(word_list,lentext=3):
66
'''
7-
ระบบค้นหาคำสำคัญ
8-
หลักการ ลบ stopword ออกแล้ว นับจำนวนคำที่ส่งค่าออกมา
9-
10-
find_keyword(word_list,lentext=3)
11-
word_list คือ คำที่อยู่ใน list
12-
lentext คือ จำนวนคำที่มีอยู่ใน list สำหรับใช้กำหนดค่าหา keyword ค่าเริ่มต้นคือ 3
7+
:param list word_list: a list of thai text
8+
:param int lentext: a number of keyword
9+
:return: dict
1310
'''
1411
filtered_words = [word for word in word_list if word not in set(stopwords.words('thai'))]
1512
word_list=rank(filtered_words)
16-
return {k:v for k, v in word_list.items() if v>=lentext}
13+
return {k:v for k, v in word_list.items() if v>=lentext}

0 commit comments

Comments
 (0)