Skip to content

Commit 010f40f

Browse files
committed
changed examples
1 parent cf0094c commit 010f40f

File tree

1 file changed

+47
-46
lines changed

1 file changed

+47
-46
lines changed

README.md

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
A command-line sound change applier written in Python.
33

44
## Setup
5-
To begin using this sound change applier, you just need to download the executable (`.exe`) file in the [releases page](https://github.com/erickcan/sound-change-applier/releases).
6-
7-
You can also clone this repo and use the `sca.bat` or `sca.sh` file:
5+
To begin using this sound change applier, you just need to download the executable (`.exe`) file in the [Releases page](https://github.com/erickcan/sound-change-applier/releases) and use it through the command-line prompt:
86
```
7+
$ sca sca-options
8+
```
9+
You can also clone this repo and use the `sca.bat` or `sca.sh` file:
10+
```sh
911
$ git clone https://github.com/erickcan/sound-change-applier.git
12+
$ sca sca-options # if Windows
13+
$ ./sca.sh sca-options # if Linux
1014
```
1115

1216
## Command line
@@ -15,81 +19,78 @@ sca (-f rules-file words-file | -n named-rules-json named-rule words)
1519
[--csv-output] [-s sound-classes-json | --no-sound-classes]
1620
```
1721
### Usage
18-
- `--file-based-sound-change` / `-f` to apply a set of rules to a set of words, each defined in a separate file, creating a text file with the changed words;
22+
- `--file-based-sound-change` | `-f` to apply a set of rules to a set of words, each defined in a separate file, creating a text file with the changed words;
1923
- `rules-file`: text file with the rules
2024
- `words-file`: text file with the words
21-
- `--named-sound-change` / `-n` to apply a named sound change to words passed on the command line, and then prints the words after the change;
25+
- `--named-sound-change` | `-n` to apply a named sound change to words passed on the command line, and then prints the words after the change;
2226
- `named-rules-json`: JSON file where sound classes are defined
23-
- `named-rule`: name of the rule to apply (defined in `named-rule-file`)
27+
- `named-rule`: name of the rule to apply (defined in `named-rules-json`)
2428
- `words`: words to apply the sound change
2529
- `--csv-output` to create a before and after of the changed words;
26-
- `--sound-classes-file` / `-s` to specify the JSON file where the sound classes are defined (see also [Default sound classes](#default-sound-classes));
30+
- `--sound-classes-file` | `-s` to specify the JSON file where the sound classes are defined (see also [Default sound classes](#default-sound-classes));
2731
- `--no-sound-classes` to not make use of sound classes.
2832

2933
### Examples
3034
Suppose the following files:
31-
3235
> named_rules.json
3336
```json
3437
{
35-
"terminal-devoicing": "[bdgz] -> [ptks] / _#",
36-
"h-dropping": "h -> _ / _",
37-
"z-rhotacization": "z -> r / V_V",
38-
"/æ/-raising": "æ -> eə / _N",
39-
"th-fronting": "[θð] -> [fv] / _"
38+
"terminal-devoicing": "[bdgz] > [ptks] / _#",
39+
"h-dropping": "h -> _ / _",
40+
"z-rhotacization": "z -> r / V_V",
41+
"l-vocalization": "l => w / _!V",
42+
"/æ/-raising": "æ => eə / _N",
43+
"th-fronting": "[θð] -> [fv] / _"
4044
}
4145
```
42-
4346
> rules.txt
4447
```
45-
d => ð / V_V
46-
a -> ə / _#
47-
[aou]e > [äöü] / _
48-
[gk] -> _ / #_n
49-
[ao]N => [ãõ] / _
50-
l -> w / _#
51-
sw > s / _[ou]
52-
s => z / [bdg]_
53-
e -> _ / CC_#
48+
d => ð / V_V
49+
[gk] -> _ / #_n
50+
a -> ə / _#
51+
l -> w / _!V
52+
[aou]e>[æøy]/ _
53+
sw > s / _[ou]
54+
[ao]N > [ãõ]/ _
55+
s => z /[bdg]_
56+
e -> _ / CC_#
5457
```
55-
5658
> words.txt
5759
```
58-
ada
60+
aeon
5961
beds
6062
clue
6163
daemon
62-
encyclopaedia
6364
knowledge
65+
laterals
66+
media
6467
sand
6568
swords
66-
vowel
6769
```
6870

69-
If this were passed to the command line:
71+
If this were passed to the command line,
7072
```
7173
$ sca -f rules.txt words.txt --csv-output
7274
```
73-
The following file would be created:
74-
75+
the following file would be created:
7576
> sound-change-YYYY-MM-DD-HH-MM-SS.csv
7677
```csv
77-
ada,aðə
78+
aeon,æõ
7879
beds,bedz
79-
clue,clü
80-
daemon,dämõ
81-
encyclopaedia,encyclopäðiə
80+
clue,cly
81+
daemon,dæmõ
8282
knowledge,nowledg
83+
laterals,lateraws
84+
media,meðiə
8385
sand,sãd
8486
swords,sordz
85-
vowel,vowew
8687
```
8788

88-
And if the following were passed into the command line:
89+
And if the following were passed into the command line,
8990
```
9091
$ sca -n named_rules.json h-dropping "here he had hallucinated"
9192
```
92-
It would print:
93+
it would print:
9394
```
9495
ere e ad allucinated
9596
```
@@ -104,15 +105,15 @@ x => y / a_b
104105
where `x` becomes `y` when `x` is between `a` and `b`. (Spaces between `>`, `->`, `=>` and `/` are insignificant.)
105106

106107
### Symbols
107-
| symbol | meaning | example |
108-
| ------- | ---------------- | ---------------------------------------------------------- |
109-
| `#` | word boundary | `_#`: end of word, `#_`: start of word |
110-
| `A..Z` | sound class | `Gt`: class `G` followed by `t` |
111-
| `[xyz]` | ad-hoc class | `u[rl]`: `u` followed by `r` or `l` |
112-
| `_` | everywhere | `ð -> d / _`: `ð` becomes `d` everywhere |
113-
| `_` | sound-eraser | `h -> _ / _`: deletes `h` everywhere |
114-
| `!_` | not proceeded by | `v -> w / u!_`: `v` into `w` when `v` not proceeded by `u` |
115-
| `_!` | not followed by | `x -> y / _!n`: `x` into `y` when `x` not followed by `n` |
108+
| symbol | meaning | example |
109+
| ------- | ---------------- | ------------------------------------------- |
110+
| `#` | word boundary | `_#`: end of word, `#_`: start of word |
111+
| `A..Z` | sound class | `Gt`: class `G` followed by `t` |
112+
| `[xyz]` | ad-hoc class | `u[rl]`: `u` followed by `r` or `l` |
113+
| `> _` | sound-eraser | `h -> _`: deletes `h` |
114+
| `_` | everywhere, when | `_x`: when followed by `x`, `_`: everywhere |
115+
| `!_` | not proceeded by | `u!_`: when not proceeded by `u` |
116+
| `_!` | not followed by | `_!n`: when not followed by `n` |
116117

117118
## Appendix
118119

0 commit comments

Comments
 (0)