Metadata-Version: 2.1
Name: dphon
Version: 0.2.0.dev0
Summary: Tools for Old Chinese phonological analysis.
Home-page: https://github.com/direct-phonology/direct
Author: John O'Leary, Nick Budak
Author-email: jo10@princeton.edu, nbudak@princeton.edu
License: MIT
Project-URL: Source, https://github.com/direct-phonology/direct
Project-URL: Tracker, https://github.com/direct-phonology/direct/issues
Keywords: cli old chinese phonology linguistics
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: Chinese (Traditional)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Topic :: Text Processing :: Markup
Classifier: Topic :: Text Processing :: Markup :: HTML
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
Requires-Dist: docopt
Provides-Extra: test
Requires-Dist: coverage ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'

# DIRECT
_Digital Intertextual Resonances in Early Chinese Texts_

[![Build Status](https://travis-ci.org/direct-phonology/direct.svg?branch=master)](https://travis-ci.org/direct-phonology/direct)
![PyPi Version](https://img.shields.io/pypi/v/dphon.svg?style=flat)
![Python Versions](https://img.shields.io/pypi/pyversions/dphon.svg?style=flat)
![License](https://img.shields.io/pypi/l/dphon.svg?style=flat)

## installation

install with pip:

```sh
$ 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:

```sh
$ 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:

```sh
揣而兌之(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:
```sh
$ dphon --help
```

## development setup

**python 3 is required**. 

first, clone the repository:

```sh
$ git clone https://github.com/direct-phonology/direct.git
$ cd direct
```

then, to create and activate a virtual environment (recommended):

```sh
$ python -m venv venv
$ source venv/bin/activate
```

install dependencies:

```sh
$ pip install -r requirements.txt
$ pip install -r dev-requirements.txt
```

finally, install the package itself in development mode:

```sh
$ 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:

```sh
$ pytest
```

## releases

to build the package for a release:

```sh
$ python setup.py sdist bdist_wheel
```

