Tools for Old Chinese phonological analysis.
Project description
DIRECT
Digital Intertextual Resonances in Early Chinese Texts
installation
install with pip:
$ pip install dphon
usage
the basic function of DIRECT is to phonologically compare two early chinese texts. you will need to have the files saved locally in utf-8 encoded plain text (.txt
) format. to compare two texts:
$ dphon text_a.txt text_b.txt # search text b against text a
the output will be a list of matching n-grams between the two texts, including the line numbers from which the matches are drawn:
揣而兌之(1277) :: 揣而銳之(531) # line 1277b matches line 531a
不可上保(1282) :: 不可長保(536) # line 1282b matches line 536a
工遂申墜(1307) :: 功遂身退(561) # line 1307b matches line 561a
...
you can view the full list of command options with:
$ dphon --help
development setup
python 3 is required.
first, clone the repository:
$ git clone https://github.com/direct-phonology/direct.git
$ cd direct
then, to create and activate a virtual environment (recommended):
$ python -m venv venv
$ source venv/bin/activate
install dependencies:
$ pip install -r requirements.txt
$ pip install -r dev-requirements.txt
finally, install the package itself in development mode:
$ pip install -e .
now your changes will be automatically picked up when you run dphon
.
tests
unit tests are written with pytest. you can run them with:
$ pytest
releases
to build the package for a release:
$ python setup.py sdist bdist_wheel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dphon-0.2.0.dev0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e95ed9767b268aef86a30b2edca5b3e8b0e68876c85bfe1e6c5423030ad4504 |
|
MD5 | 0911d6d6603be6df1ef1d2a293a357de |
|
BLAKE2b-256 | 344ee07b7fee97a97266aa5df6a541225e57c8295705bac78af2be9fe747cfda |