2020-02-16 10:58:06 -05:00
# Contributing Guide
2021-02-05 12:52:33 -05:00
Thank you for being interested in contributing to `HanLP` ! You
2020-02-16 10:58:06 -05:00
are awesome ✨.
This guideline contains information about our conventions around coding style, pull request workflow, commit messages and more.
2021-02-05 12:52:33 -05:00
This page also contains information to help you get started with development on this
2020-02-16 10:58:06 -05:00
project.
## Development
### Set-up
Get the source code of this project using git:
``` bash
2021-06-30 13:32:22 -04:00
git clone https://github.com/hankcs/HanLP --branch master
2020-02-16 10:58:06 -05:00
cd HanLP
pip install -e plugins/hanlp_trie
pip install -e plugins/hanlp_common
pip install -e plugins/hanlp_restful
pip install -e .
```
To work on this project, you need Python 3.6 or newer.
### Running Tests
This project has a test suite to ensure certain important APIs work properly. The tests can be run using:
2022-03-10 14:33:15 -05:00
``` bash
2021-06-30 13:32:22 -04:00
python -m unittest discover ./tests
2020-02-16 10:58:06 -05:00
```
2022-03-10 14:33:15 -05:00
```{tip}
2020-02-16 10:58:06 -05:00
It's hard to cover every API especially those of deep learning models, due to the limited computation resource of CI. However, we suggest all inference APIs to be tested at least.
2022-03-10 14:33:15 -05:00
` ``
2020-02-16 10:58:06 -05:00
2021-02-04 22:38:28 -05:00
## Repository Structure
2020-02-16 10:58:06 -05:00
This repository is a split into a few critical folders:
hanlp/
: The HanLP core package, containing the Python code.
plugins/
: Contains codes shared across several individual packages or non core APIs.
docs/
: The documentation for HanLP, which is in markdown format mostly.
: The build configuration is contained in ` conf.py`.
tests/
: Testing infrastructure that uses ` unittest` to ensure the output of API is what we expect it to be.
2021-02-05 12:52:33 -05:00
.github/
2020-02-16 10:58:06 -05:00
: Contains Continuous-integration (CI) workflows, run on commits/PRs to the GitHub repository.