Sound Change API
Sound Change API
Apply SCA²-style rules through a stateless REST endpoint. Requests may contain up to 10,000 entries.
Back to Sound Change ApplierGET /api/sound-changes?rules=p%2Ff%2F_&words=pata%0Apataka
POST /api/sound-changes
{
"categories": "V=aeiou\nC=ptkbdg",
"rewriteRules": "sh|š",
"rules": "p/f/_\nt/d/#_",
"words": ["pataka", "pata"],
"rewriteOnOutput": false,
"showIntermediate": false,
"intermediateOnly": false,
"outputFormat": "inputToOutput"
}rulesRequired sound-change program.
words or lexiconRequired newline-separated entries.
categories or catsCategory definitions.
rewriteRules or rewritesPreprocessing rewrite rules.
rewriteOnOutputUse 1 or true to reverse rewrites.
showIntermediateUse 1 or true to include -* stages.
intermediateOnlyReturn only marked stages.
outputFormat or formatoutput, inputToOutput, or outputWithInput.
{
"outputs": [
{
"input": "pataka",
"output": "pataka → fataka",
"appliedRuleIndexes": [1]
}
],
"ruleErrors": []
}The rule language follows Mark Rosenfelder's original SCA² Sound Change Applier. Mundifex is not affiliated with Zompist or Mark Rosenfelder; I am simply a huge fan.
The Mundifex engine is a JavaScript adaptation of Diachronr, a Ruby gem I released in 2017 so a Rails application could apply sound changes to thousands of words at once. Diachronr was a greenroom implementation of the original SCA² Sound Change Applier. This API continues that bulk-first use case with a 10,000-entry request limit.