You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-46Lines changed: 47 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,15 @@
2
2
A command-line sound change applier written in Python.
3
3
4
4
## 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:
8
6
```
7
+
$ sca sca-options
8
+
```
9
+
You can also clone this repo and use the `sca.bat` or `sca.sh` file:
-`--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;
19
23
-`rules-file`: text file with the rules
20
24
-`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;
22
26
-`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`)
24
28
-`words`: words to apply the sound change
25
29
-`--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));
27
31
-`--no-sound-classes` to not make use of sound classes.
28
32
29
33
### Examples
30
34
Suppose the following files:
31
-
32
35
> named_rules.json
33
36
```json
34
37
{
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] / _"
40
44
}
41
45
```
42
-
43
46
> rules.txt
44
47
```
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_#
54
57
```
55
-
56
58
> words.txt
57
59
```
58
-
ada
60
+
aeon
59
61
beds
60
62
clue
61
63
daemon
62
-
encyclopaedia
63
64
knowledge
65
+
laterals
66
+
media
64
67
sand
65
68
swords
66
-
vowel
67
69
```
68
70
69
-
If this were passed to the command line:
71
+
If this were passed to the command line,
70
72
```
71
73
$ sca -f rules.txt words.txt --csv-output
72
74
```
73
-
The following file would be created:
74
-
75
+
the following file would be created:
75
76
> sound-change-YYYY-MM-DD-HH-MM-SS.csv
76
77
```csv
77
-
ada,aðə
78
+
aeon,æõ
78
79
beds,bedz
79
-
clue,clü
80
-
daemon,dämõ
81
-
encyclopaedia,encyclopäðiə
80
+
clue,cly
81
+
daemon,dæmõ
82
82
knowledge,nowledg
83
+
laterals,lateraws
84
+
media,meðiə
83
85
sand,sãd
84
86
swords,sordz
85
-
vowel,vowew
86
87
```
87
88
88
-
And if the following were passed into the command line:
89
+
And if the following were passed into the command line,
89
90
```
90
91
$ sca -n named_rules.json h-dropping "here he had hallucinated"
91
92
```
92
-
It would print:
93
+
it would print:
93
94
```
94
95
ere e ad allucinated
95
96
```
@@ -104,15 +105,15 @@ x => y / a_b
104
105
where `x` becomes `y` when `x` is between `a` and `b`. (Spaces between `>`, `->`, `=>` and `/` are insignificant.)
0 commit comments