Skip to content

Commit

Permalink
Update appveyvor.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bact committed Oct 8, 2019
1 parent 1353ecf commit 7726eac
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 36 deletions.
20 changes: 10 additions & 10 deletions appveyor.docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ install:
- sudo pip install --upgrade "tensorflow>=1.14,<2" deepcut
- sudo pip install --upgrade boto smart_open sphinx sphinx-rtd-theme

# configuration for deploy mode, commit message with /(build and deloy docs)/
# 1. build documents and upload HTML files to Appveyor's storage
# 2. upload to thainlp.org/pythainlp/docs/<brnach_bane>
# Configuration for deploy mode, commit message with /(build and deloy docs)/
# 1. Build documents and upload HTML files to Appveyor's storage
# 2. Upload to thainlp.org/pythainlp/docs/<brnach_bane>

only_commits:
message: /(build and deploy docs)/
Expand All @@ -39,22 +39,22 @@ build_script:
- export RELEASE=$(echo $RELEASE | cut -d'-' -f1)
- export TODAY=$(date +'%Y-%m-%d')
- make html
- echo "Done building HTML files for the branch -- $APPVEYOR_REPO_BRANCH"
- echo "Start cleaning the directory /docs/$APPVEYOR_REPO_BRANCH"
- echo "Done building HTML files for the branch: $APPVEYOR_REPO_BRANCH"
- echo "Start cleaning the directory: /docs/$APPVEYOR_REPO_BRANCH"
- sudo bash ./clean_directory.sh $FTP_USER $FTP_PASSWORD $FTP_HOST $APPVEYOR_REPO_BRANCH
- echo "Start Uploading files to thainlp.org/pythainlp/docs/$APPVEYOR_REPO_BRANCH"
- echo "Start uploading files from: ./build/html"
- echo "to: thainlp.org/pythainlp/docs/$APPVEYOR_REPO_BRANCH"
- cd ./_build/html
- echo "cd to ./build/html"
- find . -type f -name "*" -print -exec curl --ftp-create-dir --ipv4 -T {} ftp://${FTP_USER}:${FTP_PASSWORD}@${FTP_HOST}/public_html/pythainlp/docs/$APPVEYOR_REPO_BRANCH/{} \;
- echo "Done uploading"
- echo "Done uploading files to -- thainlp.org/pythainlp/docs/$APPVEYOR_REPO_BRANCH"
- echo "Done uploading."
- echo "Files uploaded to: thainlp.org/pythainlp/docs/$APPVEYOR_REPO_BRANCH"

artifacts:
- path: ./docs/_build/html
name: document

after_build:
- echo "Done build and deploy"
- echo "Done build and deploy."
- appveyor exit

test: off
22 changes: 12 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ skip_commits:
environment:
global:
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
PYTHONIOENCODING: "utf-8"
ICU_VERSION: "64.2"

matrix:
# - PYTHON: "C:/Python36"
# PYTHON_VERSION: "3.6"
Expand Down Expand Up @@ -46,36 +49,35 @@ environment:
# DISTUTILS_USE_SDK: "1"

init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
# - ps: "ls C:/Python*"
- ECHO "PYTHON %PYTHON%"
- ECHO "PYTHON_VERSION %PYTHON_VERSION%"
- ECHO "PYTHON_ARCH %PYTHON_ARCH%"
- ECHO "Installed SDKs:"
- ps: "ls C:/Python*"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
- IF "%ARCH%"=="32" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86) ELSE (ECHO "Probably a 64-bit build")
- IF "%ARCH%"=="64" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64) ELSE (ECHO "Probably a 32-bit build")

platform:
- x64

install:
- chcp 65001
- set PYTHONIOENCODING=utf-8
# - set ICU_VERSION=64.2
# - ECHO Installed SDKs:
# - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
- IF "%ARCH%"=="32" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86) ELSE (ECHO "Probably a 64-bit build")
- IF "%ARCH%"=="64" (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64) ELSE (ECHO "Probably a 32-bit build")
- '"%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %PLATFORM%'
- ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 }
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
- python --version
- pip --version
# - "%PYTHON%\\python.exe -m pip install wheel"
- pip install --disable-pip-version-check --user --upgrade pip setuptools
- pip install coveralls[yaml]
- pip install coverage
- pip install "tensorflow>=1.14,<2" deepcut
# There is no 32-bit build for torch
- pip install torch==1.2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip install %PYICU_PKG%
- pip install %ARTAGGER_PKG%
- pip install -e .[full]

test_script:
- python --version
- pip --version
- python setup.py test
1 change: 1 addition & 0 deletions docs/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#!/bin/bash
make html
20 changes: 10 additions & 10 deletions docs/clean_directory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ BRANCH_NAME=$4
remove_all_files()
{
# DIRECTORY=$1
echo "delete files in: $1"
for f in `curl --list-only --ftp-create-dirs --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST/$1/`; do
echo "Delete files in: $1"
for f in `curl --list-only --ftp-create-dirs --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST/$1/`; do
if [[ -d "$f" ]] || [[ "$f" = _* ]] || [[ "$f" = .doctree ]] || [[ "$f" != *"."* ]]; then
echo "--- deleting files in folder: $1/$f";
remove_all_files $1/$f
else
echo "delete a file: $f"
echo "Delete a file: $f"
curl --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST -Q "DELE $1/$f"
fi
done
Expand All @@ -30,25 +30,25 @@ remove_all_files()
remove_empty_folders()
{

echo "delete empty folders in: $1"
for f in `curl --list-only --ftp-create-dirs --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST/$1/`; do
echo "Delete empty folders in: $1"
for f in `curl --list-only --ftp-create-dirs --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST/$1/`; do
if [[ -d "$f" ]] || [[ "$f" = _* ]] || [[ "$f" = fonts ]] || [[ "$f" = pythainlp ]] || [[ "$f" = .doctree ]] || [[ "$f" != *"."* ]]; then
echo "--- deleting folders in: $1/$f";
echo "--- Deleting folders in: $1/$f";
remove_empty_folders $1/$f
curl --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST -Q "RMD $1/$f"
else
echo "delete a folder: $f"
echo "Delete a folder: $f"
curl --ipv4 ftp://$FTP_USER:$FTP_PASSWORD@$FTP_HOST -Q "RMD $1/$f"
fi
done
}

echo "Start removing all files within 'public_html/pythainlp/docs/$BRANCH_NAME/'";
echo "Start removing all files within: public_html/pythainlp/docs/$BRANCH_NAME/";

remove_all_files public_html/pythainlp/docs/$BRANCH_NAME;

echo "Start removing all empty folders within 'public_html/pythainlp/docs/$BRANCH_NAME/'";
echo "Start removing all empty folders within: public_html/pythainlp/docs/$BRANCH_NAME/";

remove_empty_folders public_html/pythainlp/docs/$BRANCH_NAME;

echo "Done";
echo "Done.";
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
current_branch = '<unknown>'

# The short X.Y version
version = '{} ({}) </br> Published date: {}'.format(current_branch, release, today)
version = '{} ({}) <br /> Published date: {}'.format(current_branch, release, today)

# The full version, including alpha/beta/rc tags
release = release
Expand Down Expand Up @@ -186,7 +186,7 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/', None),
'NLTK': ('http://nltk.org', None),
'NLTK': ('http://www.nltk.org', None),
}

# -- Options for todo extension ----------------------------------------------
Expand Down
10 changes: 6 additions & 4 deletions docs/notes/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Getting Started
=====================================
===============

PyThaiNLP is a Python library for natural language processing (NLP) of Thai language. With this package, you can perform NLP tasks such as text classification and text tokenization.

**Tokenization Example**::
Expand All @@ -16,6 +17,7 @@ Thai has historically faced a lot of NLP challenges. A quick list of them includ

#. **Word segmentation** - Thai does not use space and word segmentation is not easy. It boils down to understanding the context and ruling out words that do not make sense. This is a similar issue that other Asian languages such as Japanese and Chinese face in different degrees. For languages with space, a similar but less extreme problem would be multi-word expressions, like the French word for potato — 'pomme de terre'. In Thai, the best known example is "ตา-กลม" and "ตาก-ลม". As of recent, new techniques that capture words, subwords, and letters in vectors seem poised to overcome to issue.

**Example for classification**

https://github.com/PyThaiNLP/pythainlp/tree/dev/notebooks
Tutorial Notebooks
==================
- [PyThaiNLP Get Started](https://www.thainlp.org/pythainlp/tutorials/notebooks/pythainlp-get-started.html)
- [Other tutorials](https://www.thainlp.org/pythainlp/tutorials/)

0 comments on commit 7726eac

Please sign in to comment.