Skip to content

Commit 241add0

Browse files
committed
Deprecate Python 2 support #107
1 parent c717e8e commit 241add0

File tree

8 files changed

+5
-23
lines changed

8 files changed

+5
-23
lines changed

Diff for: .travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
language: python
55
python:
6-
- "2.7"
76
- "3.4"
87
- "3.5"
98
- "3.6"

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Thai natural language processing in Python.
1212
PyThaiNLP is a python module similar to `nltk` , but it's working primarily on
1313
Thai language instead of English.
1414

15-
It supports both Python 2.7 and Python 3.
15+
It supports both Python 3.4+
1616

1717
### Capability
1818

@@ -52,7 +52,7 @@ Natural language processing หรือ การประมวลผลภา
5252

5353
> เพราะโลกขับเคลื่อนต่อไปด้วยการแบ่งปัน
5454
55-
รองรับ Python 2.7 และ Python 3
55+
รองรับ Python 3.4 ขึ้นไป
5656

5757
- หน้าหลัก GitHub : [https://github.com/PyThaiNLP/pythainlp/](https://github.com/PyThaiNLP/pythainlp/)
5858

Diff for: pythainlp/sentiment/__init__.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import,unicode_literals,print_function
3-
import six
4-
import sys
5-
if six.PY2:
6-
print("Thai sentiment in pythainlp. Not support python 2.7")
7-
sys.exit(0)
83
import pythainlp
94
from pythainlp.corpus import stopwords
105
import os
@@ -28,4 +23,4 @@ def sentiment(text):
2823
return classifier.classify(featurized_test_sentence)
2924
if __name__ == '__main__':
3025
d="เสียใจแย่มากเลย"
31-
print(sentiment(d))
26+
print(sentiment(d))

Diff for: pythainlp/spell/hunspell.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
from __future__ import absolute_import,print_function,unicode_literals
33
from builtins import *
44
import subprocess
5-
import six
65
import sys
7-
if six.PY2:
8-
print("Not support python 2.7")
9-
sys.exit(0)
106

117
def spel1(word,lang='th_TH'):
128
"""เป็นคำสั่งตรวจคำผิดโดยใช้ hunspell

Diff for: pythainlp/tag/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def pos_tag(list_text,engine='unigram',corpus='orchid'):
2020
elif engine=='perceptron':
2121
from .perceptron import tag
2222
elif engine=='artagger':
23-
if sys.version_info < (3,4):
24-
sys.exit('Sorry, Python < 3.4 is not supported')
2523
def tag(text1):
2624
try:
2725
from artagger import Tagger

Diff for: pythainlp/tag/perceptron.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import absolute_import,division,unicode_literals
3-
import six
43
import sys
5-
if six.PY2:
6-
print("Thai sentiment in pythainlp. Not support python 2.7")
7-
sys.exit(0)
84
import os
95
import pythainlp
106
import nltk.tag
@@ -28,4 +24,4 @@ def tag(text,corpus):
2824
return tagger.tag(text)
2925
elif corpus=='pud':
3026
tagger = pud_data()
31-
return tagger.tag(text)
27+
return tagger.tag(text)

Diff for: pythainlp/ulmfit/utils.py

-2
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,3 @@ def about():
166166
Development : Charin Polpanumas
167167
GitHub : https://github.com/cstorm125/thai2vec
168168
'''
169-
170-

Diff for: setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.6
2+
current_version = 1.7
33
commit = True
44
tag = True
55

0 commit comments

Comments
 (0)