-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from fearful-symmetry/phonetic_generator
Add Phonetic generator
- Loading branch information
Showing
23 changed files
with
967 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"transforms": { | ||
"latin-from-verb": { | ||
"transforms": [ | ||
{ | ||
"match_replace": { | ||
"old": "ere", | ||
"new": "plum" | ||
} | ||
}, | ||
{ | ||
"prefix": { | ||
"value": "ex" | ||
} | ||
} | ||
] | ||
}, | ||
"of-from-latin": { | ||
"transforms": [ | ||
{ | ||
"match_replace": { | ||
"old": "exe", | ||
"new": "esse" | ||
} | ||
}, | ||
{ | ||
"match_replace": { | ||
"old": "um", | ||
"new": "e" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"groups": { | ||
"V": [ | ||
"e", | ||
"a" | ||
], | ||
"S": [ | ||
"VC", | ||
"CCV", | ||
"VyV" | ||
], | ||
"C": [ | ||
"x", | ||
"m", | ||
"p", | ||
"l" | ||
] | ||
}, | ||
"lexis_types": { | ||
"word_rule": [ | ||
"SSS", | ||
"SCSS" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Creating new words with phonetic rules | ||
|
||
In addition to creating word based on etymological rules and word relationships, Kirum can also generate | ||
words from base phonetic rulesets, without any pre-existing etymology. | ||
|
||
To generate phonetic rules, a Kirum project must have one or more JSON rule files under `phonetics/` in the root project directory. These files are formatted as such: | ||
|
||
```json | ||
{ | ||
"groups": { | ||
"V": [ | ||
"e", | ||
"a" | ||
], | ||
"S": [ | ||
"VC", | ||
"CCV", | ||
"VyV" | ||
], | ||
"C": [ | ||
"x", | ||
"m", | ||
"p", | ||
"l" | ||
] | ||
}, | ||
"lexis_types": { | ||
"word_rule": [ | ||
"SSS", | ||
"SCSS" | ||
] | ||
} | ||
} | ||
|
||
``` | ||
|
||
This phonetic file is divided into two maps: | ||
- `groups`: breaks down possible groups of letters and consonants. The key of a group can be any uppercase unicode character, the values of an individual group can be any unicode value, or any uppercase group key. | ||
In the above example, `V` are the language's possible vowels, `S` are the possible syllables, and `C` are | ||
the possible consonants. | ||
- `lexis_rules`: are the possible words that are derived from the specified group rules. | ||
|
||
To generate a word from a set of specified phonetic rules, simply add the given `lexis_types` value to | ||
the lexis's `generate` field: | ||
```json | ||
"latin_verb": { | ||
"type": "word", | ||
"generate": "word_rule", | ||
"language": "Latin", | ||
"definition": "To buy, remove", | ||
"part_of_speech": "verb", | ||
"archaic": true | ||
} | ||
``` | ||
|
||
Note that the generator will not apply a new word if the lexis has both a `generate` and `word` field. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"words": { | ||
"latin_verb": { | ||
"type": "word", | ||
"generate": "word_rule", | ||
"language": "Latin", | ||
"definition": "To buy, remove", | ||
"part_of_speech": "verb", | ||
"archaic": true | ||
}, | ||
"latin_example": { | ||
"type": "word", | ||
"language": "Latin", | ||
"definition": "an instance, model, example", | ||
"part_of_speech": "noun", | ||
"etymology": { | ||
"etymons": [ | ||
{ | ||
"etymon": "latin_verb", | ||
"transforms": [ | ||
"latin-from-verb" | ||
] | ||
} | ||
] | ||
}, | ||
"archaic": true, | ||
"tags": [ | ||
"example", | ||
"default" | ||
], | ||
"derivatives": [ | ||
{ | ||
"lexis": { | ||
"language": "Old French", | ||
"definition": "model, example", | ||
"part_of_speech": "noun", | ||
"archaic": true | ||
}, | ||
"transforms": [ | ||
"of-from-latin" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.