Skip to content

Commit ec914f8

Browse files
authored
Merge pull request #127 from bact/dev
Update examples and remove Jupyter notebook checkpoints
2 parents ac62d58 + 88cba7b commit ec914f8

25 files changed

+57
-887
lines changed

.editorconfig

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/วิธีติดตั้ง PyThaiNLP เวชั่นล่าสุดจาก GitHub.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/collation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
23
from pythainlp.collation import collation
3-
print(collation(['ไก่','ไข่','ก','ฮา'])) # ['ก', 'ไก่', 'ไข่', 'ฮา']
4+
5+
print(collation(["ไก่", "ไข่", "ก", "ฮา"])) # ['ก', 'ไก่', 'ไข่', 'ฮา']

examples/etcc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
23
from pythainlp.tokenize import etcc
3-
print(etcc.etcc('คืนความสุข')) # /คืน/ความสุข
4+
5+
print(etcc.etcc("คืนความสุข")) # /คืน/ความสุข

examples/normalize.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
23
from pythainlp.util import normalize
3-
print(normalize("เเปลก")=="แปลก") # เ เ ป ล ก กับ แปลก
4+
5+
print(normalize("เเปลก") == "แปลก") # เ เ ป ล ก กับ แปลก

examples/romanization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# -*- coding: utf-8 -*-
2+
23
from pythainlp.romanization import romanization
3-
print(romanization("แมว"))
4+
5+
print(romanization("แมว"))

examples/segment.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/soundex.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# -*- coding: utf-8 -*-
2-
from pythainlp.soundex import LK82,Udom83
3-
print(LK82('รถ')==LK82('รด'))
4-
print(Udom83('วรร')==Udom83('วัน'))
2+
3+
from pythainlp.soundex import LK82, Udom83
4+
5+
print(LK82("รถ") == LK82("รด"))
6+
7+
print(Udom83("วรร") == Udom83("วัน"))

examples/spell.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# -*- coding: utf-8 -*-
2-
from pythainlp.spell import *
3-
a=spell("สี่เหลียม")
4-
print(a) # ['สี่เหลี่ยม']
2+
3+
from pythainlp.spell import spell
4+
5+
a = spell("สี่เหลียม")
6+
print(a) # ['สี่เหลี่ยม']
7+
8+
# a = spell("สี่เหลียม", engine="hunspell") # available in some Linux systems

examples/tcc.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
# -*- coding: utf-8 -*-
2+
23
from pythainlp.tokenize import tcc
3-
print(tcc.tcc('ประเทศไทย')) # ป/ระ/เท/ศ/ไท/ย
4+
5+
print(tcc.tcc("ประเทศไทย")) # ป/ระ/เท/ศ/ไท/ย
6+
7+
print(tcc.tcc_pos("ประเทศไทย")) # {1, 3, 5, 6, 8, 9}
8+
9+
for ch in tcc.tcc_gen("ประเทศไทย"): # ป-ระ-เท-ศ-ไท-ย-
10+
print(ch, end='-')

0 commit comments

Comments
 (0)