Skip to content

Commit

Permalink
Deprecate Python 2 support #107
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Aug 11, 2018
1 parent c717e8e commit 241add0
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 23 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,6 @@

language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -12,7 +12,7 @@ Thai natural language processing in Python.
PyThaiNLP is a python module similar to `nltk` , but it's working primarily on
Thai language instead of English.

It supports both Python 2.7 and Python 3.
It supports both Python 3.4+

### Capability

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

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

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

Expand Down
7 changes: 1 addition & 6 deletions pythainlp/sentiment/__init__.py
@@ -1,10 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import,unicode_literals,print_function
import six
import sys
if six.PY2:
print("Thai sentiment in pythainlp. Not support python 2.7")
sys.exit(0)
import pythainlp
from pythainlp.corpus import stopwords
import os
Expand All @@ -28,4 +23,4 @@ def sentiment(text):
return classifier.classify(featurized_test_sentence)
if __name__ == '__main__':
d="เสียใจแย่มากเลย"
print(sentiment(d))
print(sentiment(d))
4 changes: 0 additions & 4 deletions pythainlp/spell/hunspell.py
Expand Up @@ -2,11 +2,7 @@
from __future__ import absolute_import,print_function,unicode_literals
from builtins import *
import subprocess
import six
import sys
if six.PY2:
print("Not support python 2.7")
sys.exit(0)

def spel1(word,lang='th_TH'):
"""เป็นคำสั่งตรวจคำผิดโดยใช้ hunspell
Expand Down
2 changes: 0 additions & 2 deletions pythainlp/tag/__init__.py
Expand Up @@ -20,8 +20,6 @@ def pos_tag(list_text,engine='unigram',corpus='orchid'):
elif engine=='perceptron':
from .perceptron import tag
elif engine=='artagger':
if sys.version_info < (3,4):
sys.exit('Sorry, Python < 3.4 is not supported')
def tag(text1):
try:
from artagger import Tagger
Expand Down
6 changes: 1 addition & 5 deletions pythainlp/tag/perceptron.py
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import,division,unicode_literals
import six
import sys
if six.PY2:
print("Thai sentiment in pythainlp. Not support python 2.7")
sys.exit(0)
import os
import pythainlp
import nltk.tag
Expand All @@ -28,4 +24,4 @@ def tag(text,corpus):
return tagger.tag(text)
elif corpus=='pud':
tagger = pud_data()
return tagger.tag(text)
return tagger.tag(text)
2 changes: 0 additions & 2 deletions pythainlp/ulmfit/utils.py
Expand Up @@ -166,5 +166,3 @@ def about():
Development : Charin Polpanumas
GitHub : https://github.com/cstorm125/thai2vec
'''


2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.6
current_version = 1.7
commit = True
tag = True

Expand Down

0 comments on commit 241add0

Please sign in to comment.