Skip to content

Commit fd8dbae

Browse files
committed
fix pip install
1 parent 7707c19 commit fd8dbae

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Natural language processing หรือ การประมวลภาษา
2828
### สิ่งใหม่ที่เพิ่มเข้ามาใน PyThaiNLP 1.4
2929

3030
- รองรับ Thai Character Clusters (TCC) และ ETCC
31+
- Thai WordNet ตัวใหม่
3132

3233
### ความสามารถ
3334
- ตัดคำภาษาไทย
@@ -78,7 +79,7 @@ $ CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip i
7879

7980
# เอกสารการใช้งานเบื้องต้น
8081

81-
อ่านได้ที่ https://github.com/wannaphongcom/pythainlp/blob/master/docs/pythainlp-1-4-thai.md
82+
อ่านได้ที่ https://github.com/wannaphongcom/pythainlp/blob/pythainlp1.4/docs/pythainlp-1-4-thai.md
8283

8384
### License
8485

pythainlp/sentiment/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@
99
import pythainlp
1010
import os
1111
from pythainlp.tokenize import word_tokenize
12-
import dill
12+
try:
13+
import dill
14+
except ImportError:
15+
import pip
16+
pip.main(['install','dill'])
17+
try:
18+
import dill
19+
except ImportError:
20+
print("Error ! using 'pip install dill'")
21+
sys.exit(0)
22+
1323
templates_dir = os.path.join(os.path.dirname(pythainlp.__file__), 'sentiment')
1424
def sentiment(text):
1525
"""

pythainlp/tag/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ def pos_tag(text,engine='old'):
1717
if sys.version_info < (3,4):
1818
sys.exit('Sorry, Python < 3.4 is not supported')
1919
def tag(text1):
20-
from artagger import Tagger
20+
try:
21+
from artagger import Tagger
22+
except ImportError:
23+
import pip
24+
pip.main(['install','https://github.com/franziz/artagger/archive/master.zip'])
25+
try:
26+
from artagger import Tagger
27+
except ImportError:
28+
print("Error ! using 'pip install https://github.com/franziz/artagger/archive/master.zip'")
29+
sys.exit(0)
2130
tagger = Tagger()
2231
words = tagger.tag(' '.join(text1))
2332
totag=[]

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
'marisa_trie',
1111
'langdetect'
1212
]
13-
if sys.version_info >= (3,4):
14-
requirements.append('artagger')
15-
requirements.append('dill')
1613

1714
test_requirements = [
1815
# TODO: put package test requirements here

0 commit comments

Comments
 (0)