Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PyThaiNLP/pythainlp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.1
Choose a base ref
...
head repository: PyThaiNLP/pythainlp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dev
Choose a head ref
Loading
Showing 352 changed files with 501,388 additions and 5,715 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# See also http://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
blank_issues_enabled: true
16 changes: 12 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -4,17 +4,25 @@ about: Propose a change or an addition เสนอความสามาร
---

## Detailed description

<!--- Provide a detailed description of the change or addition you are proposing -->
<!--- รายละเอียดการเปลี่ยนแปลงหรือสิ่งเพิ่มเติมที่คุณกำลังเสนอ -->

## Context

<!--- Why is this change important to you? How would you use it? -->
<!--- How can it benefit other users? -->
<!--- ทำไมการเปลี่ยนแปลงนี้จึงสำคัญสำหรับคุณ? คุณใช้มันทำอะไร? -->
<!--- การเปลี่ยนแปลงนี้จะเป็นประโยชน์กับผู้ใช้อื่นอย่างไร? -->

## Possible implementation

<!--- Not obligatory, but suggest an idea for implementing addition or change -->
<!--- ไม่จำเป็นต้องใส่ แต่คุณสามารถแนะนำได้ว่าการเปลี่ยนแปลงหรือเพิ่มเติมดังกล่าวน่าจะทำได้ด้วยวิธีไหน -->

## Your environment
* PyThaiNLP version:
* Python version:
* Operating system and version (distro, 32/64-bit):
* More info (Docker, VM, etc.):

- PyThaiNLP version:
- Python version:
- Operating system and version (distro, 32/64-bit):
- More info (Docker, VM, etc.):
46 changes: 0 additions & 46 deletions .github/ISSUE_TEMPLATE/issue_report.md

This file was deleted.

66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/issue_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Issue report"
description: "Create a report to help us improve รายงานปัญหา"
title: "bug: "
labels: ["NEED_TO_LABEL", "type:bug"]

body:
- type: textarea
attributes:
label: "Description"
description: "Why you consider it to be an issue or a bug?"
validations:
required: true
- type: textarea
attributes:
label: "Expected results"
description: "Tell us what should happen."
validations:
required: true
- type: textarea
attributes:
label: "Current results"
description: "Tell us what happens instead."
validations:
required: true
- type: textarea
attributes:
label: "Steps to reproduce"
description: "Steps to reproduce the behavior."
validations:
required: true
- type: input
id: "version"
attributes:
label: "PyThaiNLP version"
validations:
required: true
- type: input
id: "python"
attributes:
label: "Python version"
validations:
required: true
- type: input
id: "os"
attributes:
label: "Operating system and version"
validations:
required: true
- type: textarea
attributes:
label: More info
description: (Docker, VM, etc.)
validations:
required: false
- type: textarea
attributes:
label: "Possible solution"
description: "(Optional) Suggest a fix for the issue, or ideas how to implement the change."
validations:
required: false
- type: textarea
attributes:
label: "Files"
description: "(Optional) A list of relevant files for this issue."
validations:
required: false
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
10 changes: 6 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
### What does this changes

Brief summary of the changes
<!--- Brief summary of the changes -->

### What was wrong

Description of what was the root cause of the issue.
<!--- Description of what was the root cause of the issue. -->

### How this fixes it

Description of how the changes fix the issue.
<!--- Description of how the changes fix the issue. -->

Fixes #...

### Your checklist for this pull request
🚨Please review the [guidelines for contributing](https://github.com/PyThaiNLP/pythainlp/blob/dev/CONTRIBUTING.md) to this repository.

<!--- Please review the guidelines for contributing to this repository at: -->
<!--- https://github.com/PyThaiNLP/pythainlp/blob/dev/CONTRIBUTING.md -->

- [ ] Passed code styles and structures
- [ ] Passed code linting checks and unit test
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
47 changes: 47 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy development documentation
on:
push:
branches:
- dev
paths-ignore:
- '**.md'
- '**.yml'
workflow_dispatch: {}

jobs:
deploy-docs:
name: Build and deploy documentation
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build tools and doc build tools
run: |
pip install --upgrade "pip<24.1" "setuptools>=65.0.2,<=73.0.1"
pip install boto smart_open sphinx sphinx-rtd-theme
# pip<24.1 because https://github.com/omry/omegaconf/pull/1195
# setuptools>=65.0.2 because https://github.com/pypa/setuptools/commit/d03da04e024ad4289342077eef6de40013630a44#diff-9ea6e1e3dde6d4a7e08c7c88eceed69ca745d0d2c779f8f85219b22266efff7fR1
# setuptools<=73.0.1 because https://github.com/pypa/setuptools/issues/4620
#- name: Install dependencies
# env:
# SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
# run: |
# if [ -f docker_requirements.txt ]; then pip install -r docker_requirements.txt; fi
- name: Install PyThaiNLP
run: pip install .
- name: Build sphinx documentation
run: |
cd docs && make html
cd ..
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: ./docs/_build/html
external_repository: PyThaiNLP/dev-docs
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
37 changes: 0 additions & 37 deletions .github/workflows/deploy_docs.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |
Hello @${{ github.actor }}, thank you for submitting a PR! We will respond as soon as possible.
สวัสดี @${{ github.actor }} ขอบคุณที่ส่ง PR เข้ามา เราจะตอบกลับให้เร็วที่สุดเท่าที่จะทำได้
issue-message: |
Hello @${{ github.actor }}, thank you for your interest in our work!
If this is a bug report, please provide screenshots and **minimum viable code to reproduce your issue**, otherwise we can not help you.
สวัสดี @${{ github.actor }} ขอบคุณที่สนใจงานของเรา
ถ้านี่เป็นรายงานข้อผิดพลาด กรุณาแนบภาพหน้าจอ ข้อความแสดงข้อผิดพลาด และ **โค้ดที่สั้นที่สุดเท่าที่จะทำให้เกิดปัญหา** เพื่อที่เราจะสามารถช่วยเหลือได้
36 changes: 10 additions & 26 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -6,40 +6,24 @@ on:
- dev
paths-ignore:
- '**.md'
- '**.yml'
- 'docs/**'
pull_request:
branches:
- dev
paths-ignore:
- '**.md'
- '**.yml'
- 'docs/**'

jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7]

ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Checkout
uses: actions/checkout@v4
- name: Ruff
uses: astral-sh/ruff-action@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install "h5py>=2.10.0,<3" "tensorflow>=2.3.1,<3"
pip install torch==1.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install deepcut
pip install .[full]
pip install flake8 flake8-commas flake8-comprehensions flake8-tidy-imports
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
src: "./pythainlp"
args: check --verbose --line-length 79 --select C901
Loading