Skip to content

Instantly share code, notes, and snippets.

@edgerunner
Last active September 22, 2020 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgerunner/74904f2109e00b068a73def360a0424a to your computer and use it in GitHub Desktop.
Save edgerunner/74904f2109e00b068a73def360a0424a to your computer and use it in GitHub Desktop.
Inflector TR
Inflector TR
a -> B Unrounded
e -> F Unrounded
ı -> B Unrounded
i -> F Unrounded
o -> B Rounded
ö -> F Unrounded
u -> B Rounded
ü -> F Unrounded
Nothing
Something&
Wovel
Front
F Rounded
F Unrounded
Back
B Rounded
B Unrounded
Consonant
a -> Medial
e -> Medial
ı -> Medial
i -> Medial
o -> Medial
ö -> Medial
u -> Medial
ü -> Medial
Medial
consonant -> Final
Final
function render(model){
const name = "Gürçağın"
analyse(model, name)
let current_state_name = model.active_states.map(s => s.name);
console.log(model)
const vowel =
model.states.Back.is_active
? "a"
: "e"
const joiner =
model.states.Medial.is_active
? "y"
: ""
return $("h1",
{style: {color: "darkBlue"}},
`${name}'${joiner}${vowel}`);
}
function analyse(machine, input) {
for (char of input.toLowerCase()) {
if ("aeıioöuü".includes(char)) {
machine.emit(char)
} else {
machine.emit("consonant")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment