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
make sure the version number in dphon/__init__.py
is correct!
to build a source archive and distribution for a release:
$ python setup.py sdist bdist_wheel
to publish the release on test PyPI (useful for making sure everything worked):
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
if everything is OK, publish the package to PyPI:
$ twine upload dist/*
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.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f33470b90ebd71cb17eaf3ffd00de40e17731a77c1cec1b91674ad98003fd0b |
|
MD5 | ef3f9d9396028fe45d7102a2be7763f1 |
|
BLAKE2b-256 | c671128da5452a20948e31f06b106a992916d27e7f1a4946eca43bfee84c9dd9 |