Skip to content

Commit

Permalink
External Juncture Calculations #1
Browse files Browse the repository at this point in the history
This was an issue brought up by someone in the Ithkuil discord, that my translations violated the external juncture rules. So I've fixed that now.
  • Loading branch information
chromonym committed Jul 28, 2022
1 parent 27af15b commit d6b80ef
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/ithkapp/favicon.ico"><link rel="apple-touch-icon" sizes="180x180" href="/ithkapp/apple-touch-icon.png"><script src="https://kit.fontawesome.com/719ae0144d.js" crossorigin="anonymous"></script><script defer="defer" src="/ithkapp/js/chunk-vendors.e35e8310.js"></script><script defer="defer" src="/ithkapp/js/app.d903eeda.js"></script><link href="/ithkapp/css/app.964c0556.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but ithkapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/ithkapp/favicon.ico"><link rel="apple-touch-icon" sizes="180x180" href="/ithkapp/apple-touch-icon.png"><script src="https://kit.fontawesome.com/719ae0144d.js" crossorigin="anonymous"></script><script defer="defer" src="/ithkapp/js/chunk-vendors.e35e8310.js"></script><script defer="defer" src="/ithkapp/js/app.181cd239.js"></script><link href="/ithkapp/css/app.964c0556.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but ithkapp doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
2 changes: 2 additions & 0 deletions dist/js/app.181cd239.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/js/app.181cd239.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/js/app.d903eeda.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/js/app.d903eeda.js.map

This file was deleted.

26 changes: 23 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@
<select id="sett10" v-model="settingRaw[10]" @change="event => settingsUpdate(event, 'hX')">
<option value="dev">Devoiced</option>
<option value="h+">As written</option>
</select>
</select><br/><br/>
<label>Don't calculate External Juncture: </label><input v-model="skipEJ" type="checkbox"/>
<br/><br/><hr/><br/><b>WARNING:</b> The below doesn't work on mobile and will cause the the webpage to not load after reloading (until you close your web browser).<br/><br/>
<button @click="setCookie('settings',JSON.stringify(settingRaw),365)">Save settings as cookies</button>
<!--<button @click="setCookie('sentence',JSON.stringify(sentence),365)">Save words as cookies (warning: buggy)</button><br/>-->
Expand Down Expand Up @@ -487,6 +488,7 @@ export default {
isMouseDown: false,
draggedWord: null,
settingRaw: ["[a]","[ɛ]","[ɤ]","[i]","[ɔ]","[œ]","[ʊ]","[ʉ]","[x]","[ʁː]","dev"],
skipEJ: false,
}
},
methods: {
Expand Down Expand Up @@ -771,6 +773,11 @@ export default {
this.fullGloss += "-" + glb[1];
}
}
if (this.selectedWord+1 in this.sentence) {
if (!["a","á","ä","â","e","ë","é","ê","i","í","o","ö","ó","ô","u","ü","ú","û"].includes(output.charAt(output.length - 1)) && !["a","á","ä","â","e","ë","é","ê","i","í","o","ö","ó","ô","u","ü","ú","û"].includes(this.sentence[this.selectedWord+1][0].charAt(0)) && !this.skipEJ) {
output += "ë"; // checking for external juncture violation
}
}
if (this.gOptions.ess2 == "RPV") {
output = this.markStress(0,output);
this.gloss += "\\RPV";
Expand Down Expand Up @@ -817,6 +824,11 @@ export default {
output += "a";
}
}
if (this.selectedWord+1 in this.sentence) {
if (!["a","á","ä","â","e","ë","é","ê","i","í","o","ö","ó","ô","u","ü","ú","û"].includes(output.charAt(output.length - 1)) && !["a","á","ä","â","e","ë","é","ê","i","í","o","ö","ó","ô","u","ü","ú","û"].includes(this.sentence[this.selectedWord+1][0].charAt(0)) && !this.skipEJ) {
output += "a"; // checking for external juncture violation
}
}
if (this.gOptions.ess2 == "RPV") {
output = this.markStress(0,output);
this.gloss += "\\RPV";
Expand Down Expand Up @@ -1656,7 +1668,7 @@ export default {
// Step 4: Join everything together
(() => {this.ithkword = this.slots.slice(0,-1).join("")})();
// Step 5: Apply Slot 10 (stress)
// Step 5: Apply Slot 10 (stress) & calculate External Juncture
// Penultimate stress is unmarked, others are marked with a diacritic; a -> á, ä -> â.
var wordVowels = this.ithkword.match(/(?:ai|äi|ei|ëi|oi|öi|ui|au|eu|ëu|ou|iu|[aeiouäëöü])/gi);
var stressType = 0;
Expand All @@ -1672,14 +1684,22 @@ export default {
}
// 5b: making sure the word can actually take the required stress
while (wordVowels.length <= stressType) { // i.e. stress 0 needs 1 vowel, stress 1 needs 2 vowels, stress 2 needs 3 vowels
var cutVal = this.cut.indexOf(true);
var cutVal = this.cut[1] == true ? 1 : this.cut[0] == true ? 0 : this.cut[2] == true ? 2 : null; //this.cut.indexOf(true);
var ph = [1,9,7];
if (ph[cutVal] === 7) {this.slots[8] = "h"}
this.slots[ph[cutVal]] = "a";
this.cut[cutVal] = false;
(() => {this.ithkword = this.slots.slice(0,-1).join("")})(); // recalculate ithkword because slots have updated
wordVowels = this.ithkword.match(/(?:ai|äi|ei|ëi|oi|öi|ui|au|eu|ëu|ou|iu|[aeiouäëöü])/gi); // recalculate wordVowels because ithkword has updated
}
if (this.selectedWord+1 in this.sentence) { // if not the last word in a sentence...
if (this.cut[1] && !["a","á","ä","â","e","ë","é","ê","i","í","o","ö","ó","ô","u","ü","ú","û"].includes(this.sentence[this.selectedWord+1][0].charAt(0)) && !this.skipEJ) {
// if slot 9 isn't already filled* and the first letter of the next word is a consonant and the user is okay with doing this
// (*not strictly necessary to check for but better safe than sorry)
this.ithkword += "a";
// add an a at the end
}
}
// 5c: marking the stress
this.ithkword = this.markStress(stressType, this.ithkword);
},
Expand Down

0 comments on commit d6b80ef

Please sign in to comment.