Skip to content

Commit 346fabc

Browse files
committed
Remove unused imports
1 parent 4671eae commit 346fabc

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ install:
9191
# - '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%'
9292
- '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%'
9393
- ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 }
94-
- SET PATH=%PYTHON%;%PYTHON%/Scripts;%PATH%
9594
- ECHO %PATH%
9695
- python --version
9796
- python -m pip install --disable-pip-version-check --user --upgrade pip setuptools

pythainlp/translate/core.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22
import os
33
import tarfile
44
from collections import defaultdict
5-
from functools import partial
65

76
from pythainlp.corpus import download, get_corpus_path
8-
from pythainlp.tokenize import word_tokenize as th_word_tokenize
97
from pythainlp.tools import get_full_data_path, get_pythainlp_data_path
108

119
from fairseq.models.transformer import TransformerModel
12-
from sacremoses import MosesDetokenizer, MosesTokenizer
10+
from sacremoses import MosesTokenizer
1311

14-
_en_word_detokenize = MosesDetokenizer("en")
15-
_en_word_tokenize = MosesTokenizer("en")
16-
#_th_word_tokenize = partial(_th_word_tokenize, keep_whitespace=False)
12+
_en_tokenizer = MosesTokenizer("en")
1713

1814
_model = None
1915
_model_name = None
@@ -73,7 +69,7 @@ def _scb_en_th_translate(text: str) -> str:
7369

7470
_scb_en_th_model_init()
7571

76-
tokens = " ".join(_en_word_tokenize.tokenize(text))
72+
tokens = " ".join(_en_tokenizer.tokenize(text))
7773
translated = _model.translate(tokens)
7874
return translated.replace(' ', '').replace('▁', ' ').strip()
7975

setup.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
1212
PyThaiNLP is a Python library for Thai natural language processing.
1313
The library provides functions like word tokenization, part-of-speech tagging,
14-
transliteration, soundex generation, and spell checking.
14+
transliteration, soundex generation, spell checking, and
15+
date and time parsing/formatting.
1516
1617
# Install
1718
@@ -29,13 +30,6 @@
2930
3031
Some functionalities, like named-entity recognition, required extra packages.
3132
See https://github.com/PyThaiNLP/pythainlp for installation options.
32-
33-
34-
Made with ❤️
35-
36-
PyThaiNLP Team
37-
38-
"We build Thai NLP"
3933
"""
4034

4135
requirements = [

0 commit comments

Comments
 (0)