Skip to main content

Tools for Old Chinese phonological analysis.

Project description

DIRECT

Digital Intertextual Resonances in Early Chinese Texts

Build Status PyPi Version Python Versions License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dphon-0.1.0.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

dphon-0.1.0-py2.py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page