Last active
September 22, 2020 12:55
-
-
Save edgerunner/74904f2109e00b068a73def360a0424a to your computer and use it in GitHub Desktop.
Inflector TR
This file contains hidden or 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
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 | |
This file contains hidden or 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
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