Skip to content

Commit 5258e49

Browse files
committed
PyThaiNLP 2.0
2 parents b73f936 + ab79eab commit 5258e49

File tree

13 files changed

+205
-7
lines changed

13 files changed

+205
-7
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ Untitled*.ipynb
7373

7474
# Document generator temporary files
7575
docs/_build/
76+
77+
\.idea/codeStyles/
78+
79+
\.idea/
80+
81+
docs/_build/doctrees/api/
82+
83+
docs/_build/html/
84+
85+
docs/_build/doctrees/

bld.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd %RECIPE_DIR%\..
2+
%PYTHON% setup.py install --single-version-externally-managed --record=record.txt

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd $RECIPE_DIR/..
2+
$PYTHON setup.py install --single-version-externally-managed --record=record.txt

buildall.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# change the package name to the existing PyPi package you would like to build and adjust the Python versions
4+
pkg='pythainlp'
5+
array=( 3.5 3.6 3.7 )
6+
7+
echo "Building conda package ..."
8+
cd ~
9+
conda skeleton pypi $pkg
10+
cd $pkg
11+
wget https://raw.githubusercontent.com/Anaconda-Platform/anaconda-client/master/conda.recipe/build.sh
12+
wget https://raw.githubusercontent.com/Anaconda-Platform/anaconda-client/master/conda.recipe/bld.bat
13+
cd ~
14+
15+
# building conda packages
16+
for i in "${array[@]}"
17+
do
18+
conda-build --python $i $pkg
19+
done
20+
21+
# convert package to other platforms
22+
cd ~
23+
platforms=( osx-64 linux-32 linux-64 win-32 win-64 )
24+
find $HOME/conda-bld/linux-64/ -name *.tar.bz2 | while read file
25+
do
26+
echo $file
27+
#conda convert --platform all $file -o $HOME/conda-bld/
28+
for platform in "${platforms[@]}"
29+
do
30+
conda convert --platform $platform $file -o $HOME/conda-bld/
31+
done
32+
33+
done
34+
35+
# upload packages to conda
36+
find $HOME/conda-bld/ -name *.tar.bz2 | while read file
37+
do
38+
echo $file
39+
anaconda upload $file
40+
done
41+
42+
echo "Building conda package done!"

conda.recipe/bld.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd %RECIPE_DIR%\..
2+
%PYTHON% setup.py install --single-version-externally-managed --record=record.txt

conda.recipe/build.shno

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd $RECIPE_DIR/..
2+
$PYTHON setup.py install --single-version-externally-managed --record=record.txt

conda.recipe/meta-old.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{% set version = "1.7.2" %}
2+
3+
package:
4+
name: pythainlp
5+
version: {{ version }}
6+
7+
build:
8+
noarch: python
9+
number: 0
10+
script: python -m pip install --no-deps --ignore-installed .
11+
12+
requirements:
13+
host:
14+
- pip
15+
- python
16+
- setuptools
17+
- nltk
18+
- future
19+
- six
20+
- marisa_trie
21+
- dill
22+
- pytz
23+
- tinydb
24+
- tqdm
25+
26+
27+
run:
28+
- python
29+
- nltk
30+
- future
31+
- six
32+
- marisa_trie
33+
- dill
34+
- pytz
35+
- tinydb
36+
- tqdm
37+
38+
test:
39+
imports:
40+
- pvlib
41+
42+
about:
43+
home: https://github.com/PyThaiNLP/pythainlp
44+
license: Apache License 2.0
45+
summary: 'Thai Natural Language Processing in Python.'
46+
47+
extra:
48+
recipe-maintainers:
49+
- pythainlp

conda.recipe/meta.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{% set version = "1.7.2" %}
2+
3+
package:
4+
name: pythainlp
5+
version: {{ version }}
6+
7+
source:
8+
path: ../
9+
#source:
10+
# git_url: https://github.com/PyThaiNLP/pythainlp.git
11+
# git_tag: {{ version }}
12+
13+
{% set export = "export" %} # [not win]
14+
{% set export = "set" %} # [win]
15+
16+
17+
build:
18+
number: 0
19+
script: python setup.py install --single-version-externally-managed --record=record.txt
20+
21+
requirements:
22+
host:
23+
- python
24+
- pip
25+
- setuptools
26+
- nltk
27+
- future
28+
- six
29+
- dill
30+
- pytz
31+
- tqdm
32+
- requests
33+
- tinydb
34+
- python-marisa-trie
35+
run:
36+
- python
37+
38+
39+
test:
40+
imports:
41+
- pythainlp
42+
43+
about:
44+
home: https://github.com/PyThaiNLP/pythainlp
45+
license: Apache License 2.0
46+
summary: 'Thai Natural Language Processing in Python.'
47+
48+
extra:
49+
recipe-maintainers:
50+
- pythainlp

meta.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% set version = "1.7.2" %}
2+
3+
package:
4+
name: pythainlp
5+
version: {{ version }}
6+
7+
8+
requirements:
9+
build:
10+
- pip
11+
- python
12+
- setuptools
13+
run:
14+
- python
15+
- nltk
16+
- future
17+
- six
18+
- conda-forge::python-marisa-trie
19+
- dill
20+
- pytz
21+
- conda-forge::tinydb
22+
- tqdm
23+
24+
test:
25+
imports:
26+
- pythainlp
27+
28+
about:
29+
home: https://github.com/PyThaiNLP/pythainlp
30+
license: Apache License 2.0
31+
summary: 'Thai Natural Language Processing in Python.'
32+
33+
extra:
34+
recipe-maintainers:
35+
- pythainlp

pythainlp/corpus/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def download(name: str, force: bool = False):
129129
if not db.search(
130130
temp.name == name and temp.version == temp_name["version"]
131131
):
132-
print("Update")
132+
print("Alert: New version is ready to be updated.")
133133
print(
134134
"from "
135135
+ name
@@ -147,7 +147,7 @@ def download(name: str, force: bool = False):
147147
download_(temp_name["download"], temp_name["file_name"])
148148
db.update({"version": temp_name["version"]}, temp.name == name)
149149
else:
150-
print("re-download")
150+
print("Redownload")
151151
print(
152152
"from "
153153
+ name

0 commit comments

Comments
 (0)