Skip to content

Commit

Permalink
Fixed glottal stop phonotactic issues
Browse files Browse the repository at this point in the history
The system now checks (just before applying stress to the word) if there are any glottal stops that have been added incorrectly - if so, it fixes them.
  • Loading branch information
chromonym committed Jan 20, 2023
1 parent 0cc10c4 commit 308a25d
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 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"><!--[if IE]><link rel="icon" href="/ithkapp/favicon.ico"><![endif]--><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.9286022d.js"></script><script defer="defer" src="/ithkapp/js/app.0abffa23.js"></script><link href="/ithkapp/css/app.3110144d.css" rel="stylesheet"><link rel="icon" type="image/svg+xml" href="/ithkapp/img/icons/favicon.svg"><link rel="icon" type="image/png" sizes="32x32" href="/ithkapp/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/ithkapp/img/icons/favicon-16x16.png"><link rel="manifest" href="/ithkapp/manifest.json"><meta name="theme-color" content="#edf3f5"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="Ithkapp"><link rel="apple-touch-icon" href="/ithkapp/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/ithkapp/img/icons/safari-pinned-tab.svg" color="#edf3f5"><meta name="msapplication-TileImage" content="/ithkapp/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#edf3f5"></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"><!--[if IE]><link rel="icon" href="/ithkapp/favicon.ico"><![endif]--><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.9286022d.js"></script><script defer="defer" src="/ithkapp/js/app.5c520568.js"></script><link href="/ithkapp/css/app.3110144d.css" rel="stylesheet"><link rel="icon" type="image/svg+xml" href="/ithkapp/img/icons/favicon.svg"><link rel="icon" type="image/png" sizes="32x32" href="/ithkapp/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/ithkapp/img/icons/favicon-16x16.png"><link rel="manifest" href="/ithkapp/manifest.json"><meta name="theme-color" content="#edf3f5"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="Ithkapp"><link rel="apple-touch-icon" href="/ithkapp/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/ithkapp/img/icons/safari-pinned-tab.svg" color="#edf3f5"><meta name="msapplication-TileImage" content="/ithkapp/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#edf3f5"></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>
1 change: 0 additions & 1 deletion dist/js/app.0abffa23.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/js/app.0abffa23.js → dist/js/app.5c520568.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/js/app.5c520568.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/service-worker.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ithkapp",
"version": "1.4.0",
"version": "1.4.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
37 changes: 36 additions & 1 deletion src/qit4/4.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ export default {
let a = conson.charAt(i);
let b = conson.charAt(i+1);
let c = conson.charAt(i+2);
if ((a != 'ʔ' && conson.split("ʔ").length >= 2) || conson.split("ʔ").length >= 3) {
if ((a != "'" && conson.split("'").length >= 2) || conson.split("'").length >= 3) {
// 2.1 No glottal stops immediately after any consonant
return false;
} else if (["t","d"].includes(a) && ["s","z","š","ž","c","","č","j","ţ",""].includes(b)) {
Expand Down Expand Up @@ -1477,6 +1477,41 @@ export default {
},
markStress(stressType,thisword) {
// FIRST, CHECK ANY ADDED GLOTTAL STOPS
if (thisword.includes("'")) {
// glottal stop has likely been added
for (let i=thisword.length;i--;){
if (thisword.charAt(i) == "'" && i != thisword.length-1){ // for each glottal stop (if not final char as failsafe):
// assume there are no consonants in FRONT of the glottal stop because that's always not allowed but check anyway
console.log(thisword.charAt(i-1));
if (["a","e","i","o","u","ä","ë","ö","ü"].includes(thisword.charAt(i-1)) && i != 0) {
console.log(thisword,thisword.charAt(i-1));
if (!["a","e","i","o","u","ä","ë","ö","ü"].includes(thisword.charAt(i+1))) { // if next is consonant
let counter = 1;
while (!["a","e","i","o","u","ä","ë","ö","ü"].includes(thisword.charAt(i+counter))) { // find how big the consonant cluster is
counter += 1;
}
let conscl = thisword.slice(i+1,i+counter);
console.log(conscl);
// recalculate for glottal stop
if (!this.allowedAtStart(conscl)) {
// if consonant cluster cannot be preceded by glottal stop, redo vowels
thisword = thisword.slice(0,i) + thisword.slice(i+1); // remove gs
if (["a","e","i","o","u","ä","ë","ö","ü"].includes(thisword.charAt(i-2)) && i >= 2) {
// if diphthong or vowel cluster
thisword = thisword.slice(0,i-1) + "'" + thisword.slice(i-1);
// move glottal stop to there
} else {
// if singular vowel
thisword = thisword.slice(0,i-1) + thisword.charAt(i-1) + "'" + thisword.slice(i-1);
// reduplicate and move glottal stop
}
}
}
}
}
}
}
var wordVowels = thisword.match(/(?:ai|ei|ëi|oi|ui|au|eu|ëu|ou|iu|[aeiouäëöü])/gi);
if (stressType === 0 && wordVowels.length > 1) { // if ultimate stress (and not single-syllable word, because that's already assumed to be ultimate)
for (let i = thisword.length-1; i >= 0; i--) {
Expand Down

0 comments on commit 308a25d

Please sign in to comment.