Last active
November 7, 2018 09:02
-
-
Save wannaphong/1e862583051bf0464b6ef4ed592f739c to your computer and use it in GitHub Desktop.
ใช้ dict ตัวเองในการตัดคำใน PyThaiNLP 1.7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
คน | |
เล่น | |
แกม | |
ตา | |
จน |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pythainlp.tokenize import dict_word_tokenize,create_custom_dict_trie | |
text="คนเล่นโอเคนะ" | |
data=create_custom_dict_trie("dict.txt") | |
print(dict_word_tokenize(text=text,custom_dict_trie=data,engine="newmm")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ผลลัพธ์
['คน', 'เล่น', 'โอเ', 'คน', 'ะ']