Skip to content

Commit

Permalink
refamiliarising myself with my code
Browse files Browse the repository at this point in the history
this is what i get for not working on this for months, i guess
  • Loading branch information
chromonym committed Oct 25, 2023
1 parent 1649f43 commit df0dba5
Show file tree
Hide file tree
Showing 7 changed files with 958 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ pnpm-debug.log*
*.sw?

# Local testing files
src/qkf
src/qkf/R*
25 changes: 16 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
</div>
<!-- END V3 WORD TYPE DROPDOWNS -->
<!-- add more word type dropdowns for more versions here, in REVERSE order -->
<!-- !@#$%^&*() <div class="dropdown" v-if="langVer == 'kb'">
<div class="dropdown" v-if="langVer == 'kb'">
<button @click="openDropdown('kayfWords')" v-click-outside="event => closeDropdown('kayfWords',event)">Word Type ▼</button>
<div class="dropdown-content hidden" id="kayfWords">
<span @click="switchWordType('normal')" :class="{active: wordType == 'normal'}">Noun</span>
<span @click="switchWordType('verb')" :class="{active: wordType == 'verb'}">Verb</span>
<span @click="switchWordType('adjv')" :class="{active: wordType == 'adjv'}">Adjective/Adverb</span>
<span @click="switchWordType('other')" :class="{active: wordType == 'other'}">Other</span>
</div>
</div> -->
</div>
</div>

<!-- MAIN (contains word-creation options) -->
Expand All @@ -71,10 +71,15 @@
@ithkword="(w) => {ithkword = w[0]; ipa = w[1]; gloss = w[2]; fullGloss = w[3]; sentence[selectedWord] = JSON.parse(JSON.stringify([ithkword,gOptions,wordType,sentence[selectedWord][3],doneOpts]));}"
:listenModal="modalListen" :listenWord="gSOptions" :listenWordtype="wordType"/>

<!-- !@#$%^&*() <TestBop v-if="langVer == 'kb'" ref="kb"
<Ithkuil_v1 v-if="langVer == '1'" ref="1"
@modal="openModal" @gEmit="(g) => gOptions = JSON.parse(JSON.stringify(g))"
@ithkword="(w) => {ithkword = w[0]; ipa = w[1]; gloss = w[2]; fullGloss = w[3]; sentence[selectedWord] = JSON.parse(JSON.stringify([ithkword,gOptions,wordType,sentence[selectedWord][3],doneOpts]));}"
:listenModal="modalListen" :listenWord="gSOptions" :listenWordtype="wordType"/>

<KayBop v-if="langVer == 'kb'" ref="kb"
@modal="openModal" @gEmit="(g) => gOptions = JSON.parse(JSON.stringify(g))"
@ithkword="(w) => {ithkword = w[0]; ipa = w[1]; gloss = w[2]; fullGloss = w[3]; sentence[selectedWord] = JSON.parse(JSON.stringify([ithkword,gOptions,wordType,sentence[selectedWord][3],doneOpts]));}"
:listenModal="modalListen" :listenWord="gSOptions" :listenWordtype="wordType"/> -->
:listenModal="modalListen" :listenWord="gSOptions" :listenWordtype="wordType"/>

</div>
<!-- END OF MAIN -->
Expand Down Expand Up @@ -193,14 +198,16 @@ import vClickOutside from "click-outside-vue3";
import Ithkuil_v4 from './qit4/4.vue';
import Ithkuil_v3 from './qit3/3.vue';
// !@#$%^&*() import TestBop from './qkf/qkf.vue';
import Ithkuil_v1 from './qit1/1.vue';
import KayBop from './qkf/qkf.vue';
export default {
name: 'App',
components: {
Ithkuil_v4,
Ithkuil_v3, // THIS ONE FOR TESTING
// !@#$%^&*() TestBop,
Ithkuil_v1,
KayBop,
},
data() {
return {
Expand Down Expand Up @@ -306,8 +313,8 @@ export default {
} else if (this.langVer == "3") {
this.closeDropdown('adj3',{},true);
this.closeDropdown('form3',{},true);
/* !@#$%^&*() } else if (this.langVer == "kb") {
this.closeDropdown('kayfWords',{},true); */
} else if (this.langVer == "kb") {
this.closeDropdown('kayfWords',{},true);
}
//this.handleSendMessage(this.gOptions.root,"root");
},
Expand Down Expand Up @@ -526,7 +533,7 @@ export default {
},
created() {
let urlParams = new URLSearchParams(window.location.search);
let validLangVers = ["4","3"]; // !@#$%^&*() ,"kb"
let validLangVers = ["4"]; // !@#$%^&*() ,"1","3","kb"
if (urlParams.has('v')) {
if (validLangVers.indexOf(urlParams.get('v')) >= 0) {
this.langVer = urlParams.get('v');
Expand Down
133 changes: 133 additions & 0 deletions src/qit1/1.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<!-- THIS IS A TEMPLATE FOR HOW TO ADD MORE ITHKUIL VERSIONS. SOME CODE WILL ALSO NEED TO BE ADDED TO APP.VUE STILL -->
<template>
<div>
<h1>Ithkapp (etʰolîpš)</h1> <!-- THE TRANSLATION IN BRACKETS IS TEMPORARY AND WILL BE RE-DONE WHEN THIS IS FINISHED -->
<p class="smalltext">As the documentation for Iţkuîl (Ithkuil I) is no longer hosted at ithkuil.net, this web app is based on <a href="https://ithkuil.place/mirror/2004-en-alt/" target="_blank">the mirror at ithkuil.place</a>.
<br/>Definitions are sometimes taken from there, sometimes taken from <a href="http://www.ithkuil.net/" target="_blank">newer Ithkuil sites</a>, and sometimes written by the creator of this site.
<br/>Glosses are <i>loosely</i> based on <a target="_blank" href="https://github.com/ngoriyasjil/IthkuilGloss">ırburučpaızya#2326</a>, which is a gloss bot for Ithkuil IV.
<br/>All past and current forms of Ithkuil and all official documentation are by John Quijada.
<br/>Click on a box's title to learn more about what it means.</p>
<div class="section"> <!-- all OptionBoxes must be in a class="section" div or else the formatting will be messed up -->
<OptionBox :json="gData.word" code="word" @send-message="handleSendMessage" ref="word" @modal="openModal"/> <!-- ref should be the same as code -->
</div>
</div>
</template>
<!-- INCLUDE A NOTE IN THE ROOT & AFFIX DESC.S THAT THE CHARACTERS š, ‘’, AND “” DON'T SHOW UP PROPERLY
(being various unicode control characters for some reason)
and so using a word-replace extension for the lexicon & affix list is advised. -->

<script>
import OptionBox from "../components/optionbox.vue"
// import grammardata from "path/to/grammardata.json"

export default {
name: "Ithkuil_v1",
components: {
OptionBox,
},
props: {
listenModal: Array,
listenWordtype: String,
listenWord: Object,
},
watch: {
// listen for variables
listenModal(arr) {
this.updateFromModal(arr[0],arr[1]);
},
/*listenWordtype(str) { // Uncomment this value if multiple word types are required - str is the word type code set up in App.vue. Also uncomment switchWordType() and wordType
this.switchWordType(str);
},*/
listenWord(obj) {
this.gOptions = JSON.parse(JSON.stringify(obj));
for (var property in obj) {
this.updateFromModal(property,JSON.parse(JSON.stringify(obj[property])));
}
this.handleSendMessage(obj.word, "word"); // recalculate the word - MAKE SURE THIS IS A PROPERTY THAT EXISTS!
},
// emit variables
ithkword(word) {
this.$emit("gEmit",this.gOptions);
this.$emit("ithkword",[word,this.ipa,this.gloss,this.fullGloss]);
},
ipa(ipa) {
this.$emit("ithkword",[this.ithkword,ipa,this.gloss,this.fullGloss]);
},
gloss(gloss) {
this.$emit("ithkword",[this.ithkword,this.ipa,gloss,this.fullGloss]);
},
fullGloss(gloss) {
this.$emit("ithkword",[this.ithkword,this.ipa,this.gloss,gloss]);
}
},
data() {
return {
defaultWord: "", // this should be whatever the default form of your "normal" word type is - whatever the algorithm generates with no option changes (ithkuil iv = "aal")
settings: { // Settings - fill in with whatever you want the user to be able to change, with the following format:
"Category A": { // Category title
"s1": ["Setting 1: ","defaultval",["defaultval","Fancy New Value"]] // dropdowns - "code": ["Visual Name","default value",[options]]
},
"Category B": {
"s2": ["Setting 2: ",false] // check boxes - "code": ["Visual Name:",true/false]
}
},
gDefault: { // this should contain all of the grammar options' (dropdowns') default values
"word": "",
},
//wordType: "", set to whatever the default word type is - UNCOMMENT WITH LISTENWORDTYPE() ABOVE AND SWITCHWORDTYPE() BELOW TO ADD MULTIPLE WORD TYPES
tabGroups: {"normal": [["word"]]}, // a dictionary representing the tab groups, based on word type
gOptions: {}, // leave as is - SHOULD BE WHERE YOU STORE/UPDATE GRAMMAR OPTIONS
ithkword: "", // leave as is - SHOULD BE THE FINAL WORD GENERATED
ipa: "", // leave as is - SHOULD BE THE IPA TRANSCRIPTION OF THE ABOVE WORD
gloss: "", // leave as is - SHOULD BE THE GLOSS (meaning) OF THE ABOVE WORD
fullGloss: "", // leave as is - SHOULD BE A LONGER VERSION OF THE ABOVE GLOSS
// gData: grammardata - uncomment when using a json file to store data
gData: { // DELETE WHEN A JSON FILE HAS BEEN MADE
"word": {'type':'text','title':'placeholder','popupdesc':'Hopefully this works :)'}
}
}
},
methods: {
async handleSendMessage(value="",code="") { // what happens when an <OptionBox> updates its value
if (code) {
this.gOptions[code] = value
// DO ANY FANCY VALUE UPDATING HERE (if necessary)
}
// RUN RECALCULATIONS HERE
this.ithkword = this.gOptions.word;
if (this.settings["Category B"].s2[1]) {this.ithkword += "AAAA"}
this.ipa = this.gOptions.word;
this.gloss = this.gOptions.word;
this.fullGloss = this.gOptions.word;
// above is a placeholder recalculation
},
openModal(code) { // leave as is - tells App.vue to open a modal
this.$emit("modal",code);
},
updateFromModal(reference,value) { // leave as is - updates a dropdown from a modal
this.$refs[reference].updateValue(value);
},
resetWord(gO=null) { // leave as is - resets the current word
if (gO == null) {
gO = this.gDefault;
}
this.gOptions = JSON.parse(JSON.stringify(gO));
for (var property in gO) {
this.updateFromModal(property,JSON.parse(JSON.stringify(gO[property])));
}
},
/*switchWordType(type) { //UNCOMMENT THIS FUNCTION TO ADD MULTIPLE WORD TYPES - THE WORD TYPES SHOULD BE SET UP IN APP.VUE
this.wordType = type;
// RECALCULATE WORDS HERE
this.handleSendMessage();
},*/
},
beforeMount() {
if (this.$cookies.isKey("ithkapp-settings1")) {
this.settings = this.$cookies.get("ithkapp-settings1"); // replace the X with whatever the relevant langVer is
}
this.gOptions = JSON.parse(JSON.stringify(this.gDefault));
this.handleSendMessage();
},
}
</script>
56 changes: 44 additions & 12 deletions src/qit3/3.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<template>
<div>
<div class="section"> <!-- all OptionBoxes must be in a class="section" div or else the formatting will be messed up -->
<OptionBox :json="gData.word" code="word" @send-message="handleSendMessage" ref="word" @modal="openModal" :class="{hidden: wordType != 'normal'}"/> <!-- ref should be the same as code -->
<OptionBox :json="gData.root" code="root" @send-message="handleSendMessage" ref="root" @modal="openModal"/> <!-- ref should be the same as code -->
<OptionBox :json="gData.desig" code="desig" @send-message="handleSendMessage" ref="desig" @modal="openModal"/>
<OptionBox :json="gData.stem" code="stem" @send-message="handleSendMessage" ref="stem" @modal="openModal"/>
<OptionBox :json="gData.pattern" code="pattern" @send-message="handleSendMessage" ref="pattern" @modal="openModal"/>
</div>
</div>
</template>

<script>
import OptionBox from "../components/optionbox.vue"
// import grammardata from "path/to/grammardata.json"
import grammardata from './grammardata.json'
export default {
name: "Ithkuil_v3",
Expand Down Expand Up @@ -62,19 +65,21 @@ export default {
}
},
gDefault: { // this should contain all of the grammar options' (dropdowns') default values
"word": "",
"root": "",
"desig":"IFL",
"stem":"s1",
"pattern":"p1"
},
wordType: "normal", // set to whatever the default word type is - UNCOMMENT WITH LISTENWORDTYPE() ABOVE AND SWITCHWORDTYPE() BELOW TO ADD MULTIPLE WORD TYPES
tabGroups: {"normal": [["word"]]}, // a dictionary representing the tab groups, based on word type
tabGroups: {"normal": [["root","desig","stem","pattern"]]}, // a dictionary representing the tab groups, based on word type
gOptions: {}, // leave as is - SHOULD BE WHERE YOU STORE/UPDATE GRAMMAR OPTIONS
ithkword: "", // leave as is - SHOULD BE THE FINAL WORD GENERATED
ipa: "", // leave as is - SHOULD BE THE IPA TRANSCRIPTION OF THE ABOVE WORD
gloss: "", // leave as is - SHOULD BE THE GLOSS (meaning) OF THE ABOVE WORD
fullGloss: "", // leave as is - SHOULD BE A LONGER VERSION OF THE ABOVE GLOSS
// gData: grammardata - uncomment when using a json file to store data
gData: { // DELETE WHEN A JSON FILE HAS BEEN MADE
"word": {'type':'text','title':'placeholder','popupdesc':'Hopefully this works :)'}
}
gData: grammardata,
slots: ["","","","","","","","","","","","","","",""],
}
},
methods: {
Expand All @@ -84,11 +89,7 @@ export default {
// DO ANY FANCY VALUE UPDATING HERE (if necessary)
}
// RUN RECALCULATIONS HERE
this.ithkword = this.gOptions.word;
if (this.settings["Category B"].s2[1]) {this.ithkword += "AAAA"}
this.ipa = this.gOptions.word;
this.gloss = this.gOptions.word;
this.fullGloss = this.gOptions.word;
this.calculateWord();
// above is a placeholder recalculation
},
openModal(code) { // leave as is - tells App.vue to open a modal
Expand All @@ -111,6 +112,37 @@ export default {
// RECALCULATE WORDS HERE
this.handleSendMessage();
},
calculateWord() {
this.calcSlot4();
this.calcSlot8();
this.ithkword = this.slots.join("");
this.ipa = this.ithkword;
this.gloss = this.ithkword;
this.fullGloss = this.ithkword;
},
// calcSlot1()
// calcSlot2()
// calcSlot3()
calcSlot4() { // still need to add Function to this
let vr = {"p1":{"s1":{"STA":"a","DYN":"i","MNF":"ui","DSC":"oi"},"s2":{"STA":"e","DYN":"ai","MNF":"ü","DSC":"eo"},"s3":{"STA":"u","DYN":"ei","MNF":"ëi","DSC":""}},
"p2":{"s1":{"STA":"o","DYN":"au","MNF":"ae","DSC":"oe"},"s2":{"STA":"ö","DYN":"eu","MNF":"ea","DSC":"öe"},"s3":{"STA":"î","DYN":"iu","MNF":"oa","DSC":"ëu"}},
"p3":{"s1":{"STA":"â","DYN":"ia","MNF":"üa","DSC":"üo"},"s2":{"STA":"ê","DYN":"ie","MNF":"","DSC":"üe"},"s3":{"STA":"ô","DYN":"io","MNF":"","DSC":"üö"}}};
this.slots[3] = vr[this.gOptions.pattern][this.gOptions.stem]["STA"];
// note that ü/ou, î/û, ia/ua, ie/ue, io/uo, üa/aì, iù/uì, iö/uö, üo/oì, üe/eì, üö/aù
},
// calcSlot5()
// calcSlot6()
// calcSlot7()
calcSlot8() {
this.slots[7] = this.gOptions.root;
},
// calcSlot9()
// calcSlot10()
// calcSlot11()
// calcSlot12()
// calcSlot13()
// calcSlot14()
// calcSlot15()
},
beforeMount() {
if (this.$cookies.isKey("ithkapp-settings3")) {
Expand Down
63 changes: 63 additions & 0 deletions src/qit3/grammardata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"root": {
"type":"text",
"title":"Root (Cr)",
"popupdesc":"The root is the general definition of the word, and can be directly modified by the Stem, Pattern annd Designation. Check the <a target=\"_blank\" href=\"https://ithkuil.net/lexicon.htm\">Lexicon</a> for what your word's Root, Stem, Pattern annd Designation should be."
},

"stem": {
"type":"",
"title":"Stem",
"options": {
"s1":{
"name": "Stem 1",
"desc": ""
},
"s2":{
"name": "Stem 2",
"desc": ""
},
"s3":{
"name": "Stem 3",
"desc": ""
}
},
"popupdesc":"The stem of a word partially describes which of the 18 or so possible definitons that a root could take is used in the word. Root-specific stem definitions are in the <a target=\"_blank\" href=\"https://ithkuil.net/lexicon.htm\">Lexicon</a>."
},

"pattern": {
"type":"",
"title":"Pattern",
"options": {
"p1":{
"name": "Pattern 1 (Holistic)",
"desc": ""
},
"p2":{
"name": "Pattern 2 (Compl. 1)",
"desc": ""
},
"p3":{
"name": "Pattern 3 (Compl. 2)",
"desc": ""
}
},
"popupdesc":"The pattern of a word partially describes which of the 18 or so possible definitons that a root could take is used in the word. Root-specific pattern definitions are in the <a target=\"_blank\" href=\"https://ithkuil.net/lexicon.htm\">Lexicon</a>."
},

"desig": {
"type":"",
"title":"Designation",
"options": {
"IFL":{
"name": "Informal",
"desc": "The INFORMAL designation indicates that the noun or verb in question does not exist in a necessarily permanent state, or is to be considered only for the duration of the context in which it is spoken, with any lasting effect, influence or permanency beyond the context being either absent, unknown or irrelevant."
},
"FML":{
"name": "Formal",
"desc": "The FORMAL designation imparts a sense of permanency and/or authority, raising the noun or verb to a more definitive, formal or institutional manifestation of itself, or stressing this authoritative/definitive nature if the meaning already includes it."
}
},
"popupdesc":"The designation of a word partially describes which of the 18 or so possible definitons that a root could take is used in the word. Root-specific designation definitions are in the <a target=\"_blank\" href=\"https://ithkuil.net/lexicon.htm\">Lexicon</a>.<br/>However, these designations also have generic meanings attached."
}
}
Loading

0 comments on commit df0dba5

Please sign in to comment.