|
1 | | -# Beta Code Converter for Python |
| 1 | +# Beta Code JSON |
2 | 2 |
|
3 | | -Converts Greek Beta Code to Greek characters and vice versa. |
| 3 | +Map of Greek Beta Code characters to Unicode and from Unicode to Beta Code. |
4 | 4 |
|
5 | | -## Installation |
| 5 | +## Standard |
6 | 6 |
|
7 | | -`pip install beta-code` |
| 7 | +The mappings in this repository aim mostly to conform to the TLG standard |
| 8 | +specified [here](http://stephanus.tlg.uci.edu/encoding.php). |
8 | 9 |
|
9 | | -(See project on [PyPI](https://pypi.org/project/beta-code/)) |
| 10 | +Not every application that uses Greek Beta Code follows the TLG standard exactly. |
| 11 | +The mappings try to capture these nonstandard uses without breaking Beta Code encoded |
| 12 | +according to the standard in the following ways: |
10 | 13 |
|
11 | | -## Usage |
| 14 | +* Lowercase Latin letters can be used in the Beta Code (e.g. `a`, `w=`) |
| 15 | +* Uppercase Greek letters can be keyed 1. asterisk, 2. breathing, 3. accent, 4. iota subscript, 5. letter (e.g. `*(=|W`) |
| 16 | +* Uppercase Greek letters can be keyed 1. asterisk, 2. letter, 3. breathing, 4. accent, 5. iota subscript (e.g. `*W(=|`) |
12 | 17 |
|
13 | | -```python |
14 | | -import beta_code |
| 18 | +## Example uses |
15 | 19 |
|
16 | | -beta_code.greek_to_beta_code(u'χαῖρε ὦ κόσμε') |
17 | | -# => 'xai=re w)= ko/sme' |
18 | | - |
19 | | -beta_code.beta_code_to_greek(u'mh=nin a)/eide qea\\ *phlhi+a/dew *)axilh=os') |
20 | | -# => 'μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος' |
21 | | -``` |
22 | | - |
23 | | -### With additional mappings |
24 | | - |
25 | | -```python |
26 | | -beta_code.beta_code_to_greek(u'f2a/nac', custom_map={ u'f2': u'ϝ' }) |
27 | | -# => 'ϝάναξ' |
28 | | -``` |
29 | | - |
30 | | -## Tests |
31 | | - |
32 | | -`python -m unittest tests/test_beta_code.py` |
33 | | - |
34 | | -### In Python 2 |
35 | | - |
36 | | -`cd tests/ && python -m unittest test_beta_code` |
37 | | - |
38 | | -## Updating JSON |
39 | | - |
40 | | -```bash |
41 | | -git subtree pull --prefix beta_code/vendor/beta-code-json/ https://github.com/perseids-tools/beta-code-json master --squash |
42 | | -``` |
43 | | - |
44 | | -In the case of a merge conflict: |
45 | | - |
46 | | -```bash |
47 | | -git checkout --theirs vendor/beta-code-json/ |
48 | | -git add vendor/beta-code-json |
49 | | -git commit |
50 | | -``` |
51 | | - |
52 | | -## Publishing |
53 | | - |
54 | | -* Install dependencies: |
55 | | - |
56 | | -```bash |
57 | | -python3 -m venv venv |
58 | | -. ./venv/bin/activate |
59 | | -pip3 install -r requirements.txt |
60 | | -``` |
61 | | - |
62 | | -* Bump version in `setup.py` |
63 | | -* Commit and push to GitHub |
64 | | -* On GitHub, create a new release |
65 | | -* Run `python3 setup.py sdist bdist_wheel` |
66 | | -* Run `python3 -m twine upload dist/*` |
67 | | - |
68 | | -## Notes |
69 | | - |
70 | | -For the mappings between Beta Code and Unicode, see [https://github.com/perseids-tools/beta-code-json](https://github.com/perseids-tools/beta-code-json). |
| 20 | +* [https://github.com/perseids-tools/beta-code-js](https://github.com/perseids-tools/beta-code-js) |
| 21 | +* [https://github.com/perseids-tools/beta-code-rb](https://github.com/perseids-tools/beta-code-rb) |
| 22 | +* [https://github.com/perseids-tools/beta-code-py](https://github.com/perseids-tools/beta-code-py) |
0 commit comments