File tree Expand file tree Collapse file tree 4 files changed +23
-6
lines changed
Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 99import pythainlp
1010import os
1111from 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+
1323templates_dir = os .path .join (os .path .dirname (pythainlp .__file__ ), 'sentiment' )
1424def sentiment (text ):
1525 """
Original file line number Diff line number Diff 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 = []
Original file line number Diff line number Diff line change 1010 'marisa_trie' ,
1111 'langdetect'
1212]
13- if sys .version_info >= (3 ,4 ):
14- requirements .append ('artagger' )
15- requirements .append ('dill' )
1613
1714test_requirements = [
1815 # TODO: put package test requirements here
You can’t perform that action at this time.
0 commit comments