Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
PonteIneptique committed Nov 2, 2017
1 parent 366d407 commit 88addcb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,35 @@ Install by cloning the repository and run
python setup.py install
```

## Via pip

```shell
pip install chetc
```

# How to use

To use ETC.py, you need to create a converter instance and configure it with a ConverterModel (Currently, only a ConverterReplacementModel for http://manfredclauss.de/gb/index.html is available)

```python
from chetc import Converter
from chetc.configs import Manfred

# We initialize a converter and disable the word tagging and numbering
converter = Converter(replacement_model=Manfred(word_numbering=False))
# We run a single transformation and print it
print(converter.convert("Sittium a[e]d(ilem) [o(ro) v(os)] f(aciatis)"))
```

should print in a single line
```xml
<lb n="1"/>Sittium
<expan><abbr>a<supplied reason="lost">e</supplied>d</abbr><ex>ilem</ex></expan>
<supplied reason="lost"><expan><abbr>o</abbr><ex>ro</ex></expan></supplied>
<supplied reason="lost"><expan><abbr>v</abbr><ex>os</ex></expan></supplied>
<expan><abbr>f</abbr><ex>aciatis</ex></expan>
```

*Warning* : if you were to run another transformation that is not following this line, you should do a `converter.reset()` to reset the line numbering.

Alternatively, you can run a list of strings to convert and this will be done automatically.

0 comments on commit 88addcb

Please sign in to comment.