master
Merryn Davies-Deacon 5 years ago
parent b1becf301b
commit 5140a571b9

@ -1,212 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Frasednow kernowek</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:400,400i,800" rel="stylesheet">
<link href="main.css" rel="stylesheet">
</head>
<body>
<form>
<input type="radio" name="person" value="1sg" checked> I
<input type="radio" name="person" value="2sg"> you (singular) <input type="radio" name="person" value="3sgm"> he
<input type="radio" name="person" value="3sgf"> she<br/>
<input type="radio" name="person" value="1pl"> we
<input type="radio" name="person" value="2pl"> you (plural)
<input type="radio" name="person" value="3pl"> they
<!--<br><input type="radio" name="person" value="all"> Show all-->
<br><br>
<select name="tensemood" id="tensemood">
<option value="present">… start(s)/(is/are) starting</option>
<option value="past">… started</option>
<option value="imperfect">… was/were starting</option>
<option value="perfect">… has/have started</option>
<option value="pluperfect">… had started</option>
<option value="emphaticpast">… did start</option>
<option value="perfectcontinuous">… has/have been starting</option>
<option value="future">… will start</option>
<option value="futureperfect">… will have started</option>
<option value="futurecontinuous">… will be starting</option>
<option value="conditional">… would start</option>
<option value="pastconditional">… would have started</option>
<option value="could">… could start</option>
<option value="should">… should start</option>
<option value="ought">… ought to start</option>
<option value="must">… must start</option>
<option value="futuremust">… will have to start</option>
<option value="conditionalmust">… would have to start</option>
<option value="presentquestion">Do(es) … start?</option>
<option value="pastquestion">Did … start?</option>
</select>
<br>
<br>
<button type="button" onclick="GetIt()">Submit</button>
</form>
<p id="translo"/>
<script>
function GetIt(){
var e = document.getElementById("tensemood");
var tensemoodValue = e.options[e.selectedIndex].value;
var ele = document.getElementsByName('person');
for(i = 0; i < ele.length; i++) {
if(ele[i].checked)
var personValue = ele[i].value;}
var combine = personValue+tensemoodValue
var dicto = {
"allofthem":[
{"english":"1sgpresent","cornish":"theroma o talla",},
{"english":"2sgpresent","cornish":"thesta o talla",},
{"english":"3sgmpresent","cornish":"ma va o talla",},
{"english":"3sgfpresent","cornish":"ma hei o talla",},
{"english":"1plpresent","cornish":"thero nei o talla",},
{"english":"2plpresent","cornish":"thero whei o talla",},
{"english":"3plpresent","cornish":"monjei o talla",},
{"english":"1sgpast","cornish":"my a dhallas",},
{"english":"2sgpast","cornish":"che a dhallas",},
{"english":"3sgmpast","cornish":"ev a dhallas",},
{"english":"3sgfpast","cornish":"hei a dhallas",},
{"english":"1plpast","cornish":"nei a dhallas",},
{"english":"2plpast","cornish":"whei a dhallas",},
{"english":"3plpast","cornish":"anjei a dhallas",},
{"english":"1sgimperfect","cornish":"thera vy o talla",},
{"english":"2sgimperfect","cornish":"thera che o talla",},
{"english":"3sgmimperfect","cornish":"thera va o talla",},
{"english":"3sgfimperfect","cornish":"thera hei o talla",},
{"english":"1plimperfect","cornish":"thera nei o talla",},
{"english":"2plimperfect","cornish":"thera whei o talla",},
{"english":"3plimperfect","cornish":"thera anjei o talla",},
{"english":"1sgperfect","cornish":"ma dallys genam",},
{"english":"2sgperfect","cornish":"ma dallys genes",},
{"english":"3sgmperfect","cornish":"ma dallys ganjo",},
{"english":"3sgfperfect","cornish":"ma dallys genji",},
{"english":"1plperfect","cornish":"ma dallys gena nei",},
{"english":"2plperfect","cornish":"ma dallys gena whei",},
{"english":"3plperfect","cornish":"ma dallys ganjans",},
{"english":"1sgpluperfect","cornish":"tho dallys genam",},
{"english":"2sgpluperfect","cornish":"tho dallys genes",},
{"english":"3sgmpluperfect","cornish":"tho dallys ganjo",},
{"english":"3sgfpluperfect","cornish":"tho dallys genji",},
{"english":"1plpluperfect","cornish":"tho dallys gena nei",},
{"english":"2plpluperfect","cornish":"tho dallys gena whei",},
{"english":"3plpluperfect","cornish":"tho dallys ganjans",},
{"english":"1sgemphaticpast","cornish":"my a wrug dalla",},
{"english":"2sgemphaticpast","cornish":"che a wrug dalla",},
{"english":"3sgmemphaticpast","cornish":"ev a wrug dalla",},
{"english":"3sgfemphaticpast","cornish":"hei a wrug dalla",},
{"english":"1plemphaticpast","cornish":"nei a wrug dalla",},
{"english":"2plemphaticpast","cornish":"whei a wrug dalla",},
{"english":"3plemphaticpast","cornish":"anjei a wrug dalla",},
{"english":"1sgperfectcontinuous","cornish":"my a veu o talla",},
{"english":"2sgperfectcontinuous","cornish":"che a veu o talla",},
{"english":"3sgmperfectcontinuous","cornish":"ev a veu o talla",},
{"english":"3sgfperfectcontinuous","cornish":"hei a veu o talla",},
{"english":"1plperfectcontinuous","cornish":"nei a veu o talla",},
{"english":"2plperfectcontinuous","cornish":"whei a veu o talla",},
{"english":"3plperfectcontinuous","cornish":"anjei a veu o talla",},
{"english":"1sgfuture","cornish":"my a vedn dalla",},
{"english":"2sgfuture","cornish":"che a vedn dalla",},
{"english":"3sgmfuture","cornish":"ev a vedn dalla",},
{"english":"3sgffuture","cornish":"hei a vedn dalla",},
{"english":"1plfuture","cornish":"nei a vedn dalla",},
{"english":"2plfuture","cornish":"whei a vedn dalla",},
{"english":"3plfuture","cornish":"anjei a vedn dalla",},
{"english":"1sgfutureperfect","cornish":"a vedh dallys genam",},
{"english":"2sgfutureperfect","cornish":"a vedh dallys genes",},
{"english":"3sgmfutureperfect","cornish":"a vedh dallys ganjo",},
{"english":"3sgffutureperfect","cornish":"a vedh dallys genji",},
{"english":"1plfutureperfect","cornish":"a vedh dallys gena nei",},
{"english":"2plfutureperfect","cornish":"a vedh dallys gena whei",},
{"english":"3plfutureperfect","cornish":"a vedh dallys ganjans",},
{"english":"1sgfuturecontinuous","cornish":"my a vedh o talla",},
{"english":"2sgfuturecontinuous","cornish":"che a vedh o talla",},
{"english":"3sgmfuturecontinuous","cornish":"ev a vedh o talla",},
{"english":"3sgffuturecontinuous","cornish":"hei a vedh o talla",},
{"english":"1plfuturecontinuous","cornish":"nei a vedh o talla",},
{"english":"2plfuturecontinuous","cornish":"whei a vedh o talla",},
{"english":"3plfuturecontinuous","cornish":"anjei a vedh o talla",},
{"english":"1sgconditional","cornish":"my a venja dalla",},
{"english":"2sgconditional","cornish":"che a venja dalla",},
{"english":"3sgmconditional","cornish":"ev a venja dalla",},
{"english":"3sgfconditional","cornish":"hei a venja dalla",},
{"english":"1plconditional","cornish":"nei a venja dalla",},
{"english":"2plconditional","cornish":"whei a venja dalla",},
{"english":"3plconditional","cornish":"anjei a venja dalla",},
{"english":"1sgpastconditional","cornish":"a via dallys genam",},
{"english":"2sgpastconditional","cornish":"a via dallys genes",},
{"english":"3sgmpastconditional","cornish":"a via dallys ganjo",},
{"english":"3sgfpastconditional","cornish":"a via dallys genji",},
{"english":"1plpastconditional","cornish":"a via dallys gena nei",},
{"english":"2plpastconditional","cornish":"a via dallys gena whei",},
{"english":"3plpastconditional","cornish":"a via dallys ganjans",},
{"english":"1sgcould","cornish":"my a alja dalla",},
{"english":"2sgcould","cornish":"che a alja dalla",},
{"english":"3sgmcould","cornish":"ev a alja dalla",},
{"english":"3sgfcould","cornish":"hei a alja dalla",},
{"english":"1plcould","cornish":"nei a alja dalla",},
{"english":"2plcould","cornish":"whei a alja dalla",},
{"english":"3plcould","cornish":"anjei a alja dalla",},
{"english":"1sgshould","cornish":"my a dalvia dalla",},
{"english":"2sgshould","cornish":"che a dalvia dalla",},
{"english":"3sgmshould","cornish":"ev a dalvia dalla",},
{"english":"3sgfshould","cornish":"hei a dalvia dalla",},
{"english":"1plshould","cornish":"nei a dalvia dalla",},
{"english":"2plshould","cornish":"whei a dalvia dalla",},
{"english":"3plshould","cornish":"anjei a dalvia dalla",},
{"english":"1sgought","cornish":"my a dal dalla",},
{"english":"2sgought","cornish":"che a dal dalla",},
{"english":"3sgmought","cornish":"ev a dal dalla",},
{"english":"3sgfought","cornish":"hei a dal dalla",},
{"english":"1plought","cornish":"nei a dal dalla",},
{"english":"2plought","cornish":"whei a dal dalla",},
{"english":"3plought","cornish":"anjei a dal dalla",},
{"english":"1sgmust","cornish":"res ew dhebm dalla",},
{"english":"2sgmust","cornish":"res ew dhis dalla",},
{"english":"3sgmmust","cornish":"res ew dhodho dalla",},
{"english":"3sgfmust","cornish":"res ew dhedhi dalla",},
{"english":"1plmust","cornish":"res ew dhe nei dalla",},
{"english":"2plmust","cornish":"res ew dhe whei dalla",},
{"english":"3plmust","cornish":"res ew dhodhans dalla",},
{"english":"1sgfuturemust","cornish":"my a dalvedh dalla",},
{"english":"2sgfuturemust","cornish":"che a dalvedh dalla",},
{"english":"3sgmfuturemust","cornish":"ev a dalvedh dalla",},
{"english":"3sgffuturemust","cornish":"hei a dalvedh dalla",},
{"english":"1plfuturemust","cornish":"nei a dalvedh dalla",},
{"english":"2plfuturemust","cornish":"whei a dalvedh dalla",},
{"english":"3plfuturemust","cornish":"anjei a dalvedh dalla",},
{"english":"1sgconditionalmust","cornish":"my a goffia dalla",},
{"english":"2sgconditionalmust","cornish":"che a goffia dalla",},
{"english":"3sgmconditionalmust","cornish":"ev a goffia dalla",},
{"english":"3sgfconditionalmust","cornish":"hei a goffia dalla",},
{"english":"1plconditionalmust","cornish":"nei a goffia dalla",},
{"english":"2plconditionalmust","cornish":"whei a goffia dalla",},
{"english":"3plconditionalmust","cornish":"anjei a goffia dalla",},
{"english":"1sgpresentquestion","cornish":"eroma o talla?",},
{"english":"2sgpresentquestion","cornish":"esta o talla?",},
{"english":"3sgmpresentquestion","cornish":"ujy va o talla?",},
{"english":"3sgfpresentquestion","cornish":"ujy hei o talla?",},
{"english":"1plpresentquestion","cornish":"ero nei o talla?",},
{"english":"2plpresentquestion","cornish":"ero whei o talla?",},
{"english":"3plpresentquestion","cornish":"ujy anjei o talla?",},
{"english":"1sgpastquestion","cornish":"a wruga vy dalla?",},
{"english":"2sgpastquestion","cornish":"a wrussta dalla?",},
{"english":"3sgmpastquestion","cornish":"a wrug ev dalla?",},
{"english":"3sgfpastquestion","cornish":"a wrug hei dalla?",},
{"english":"1plpastquestion","cornish":"a wruga nei dalla?",},
{"english":"2plpastquestion","cornish":"a wruga whei dalla?",},
{"english":"3plpastquestion","cornish":"a wrug anjei dalla?",},
],
};
var translation = {};
dicto.allofthem.forEach(function (item) {
translation[item.english] = item.cornish;});
var theenglish = translation[combine]
document.getElementById("translo").innerHTML = theenglish;
}
</script>
</body>
</html>

@ -1,25 +0,0 @@
body {
width:60%;
margin: 40px auto 0 auto;
padding: 0 20px 20px 20px;
font-family: 'Raleway', sans-serif;
border: 2px solid black;
}
#thesentences {
display:none;
}
.trans {
display:none;
font-style:italic;
}
#inputs {
font-weight:bold;
}
.prose {
font-weight:bold;
}
button {
color:white;
background-color:gray;
font-family: 'Raleway', sans-serif;
}

@ -1,522 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Frasednow kernowek</title>
<link href="https://fonts.googleapis.com/css?family=Raleway:400,400i,800" rel="stylesheet">
<style>
body {
width:60%;
margin: 40px auto 0 auto;
padding: 0 20px 20px 20px;
font-family: 'Raleway', sans-serif;
border: 2px solid black;
}
#thesentences {
display:none;
}
.trans {
display:none;
font-style:italic;
}
#inputs {
font-weight:bold;
}
.prose {
font-weight:bold;
}
button {
color:white;
background-color:gray;
font-family: 'Raleway', sans-serif;
}
</style>
<script>
function show1() {
var x = document.getElementById("thesentences");
if (x.style.display !== "block") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function show2() {
var x = document.getElementById("sentence1eng");
if (x.style.display !== "inline") {
x.style.display = "inline";
} else {
x.style.display = "none";
}
var y = document.getElementById("sentence2eng");
if (y.style.display !== "inline") {
y.style.display = "inline";
} else {
y.style.display = "none";
}
var z = document.getElementById("sentence3eng");
if (z.style.display !== "inline") {
z.style.display = "inline";
} else {
z.style.display = "none";
}
var a = document.getElementById("sep1");
if (a.style.display !== "inline") {
a.style.display = "inline";
} else {
a.style.display = "none";
}
var b = document.getElementById("sep2");
if (b.style.display !== "inline") {
b.style.display = "inline";
} else {
b.style.display = "none";
}
var c = document.getElementById("sep3");
if (c.style.display !== "inline") {
c.style.display = "inline";
} else {
c.style.display = "none";
}
}
function reloader() {
location.reload();
}
</script>
</head>
<body>
<div id="preamble">
<p>Here are a randomly generated Cornish noun and adjective, and a number. Think about how these can be combined to form sentences. To see some example sentences, click the first button below. Or you can load some new data by clicking the second button.</p>
</div>
<div id="inputs">
<p id="nouncorn"></p>
<p hidden id="nouneng"></p>
<p hidden id="nounengpl"></p>
<p hidden id="noungender"></p>
<p hidden id="nounlen"></p>
<p id="adjcorn"></p>
<p hidden id="adjeng"></p>
<p hidden id="adjlen"></p>
<p id="digit"></p>
<p hidden id="numbcorn"></p>
<p hidden id="numbeng"></p>
<p hidden id="numbfem"></p>
<p hidden id="numbuse"></p>
<p hidden id="numblen"></p>
</div>
<button onclick="show1()">Toggle sentences</button>
<button onclick="reloader()">Get new data</button>
<div id="thesentences">
<hr/>
<p>
<span class="prose" id="sentence1"></span>
<span class="trans" id="sep1"></span>
<span class="trans" id="sentence1eng"></span>
</p><p>
<span class="prose" id="sentence2"></span>
<span class="trans" id="sep2"></span>
<span class="trans" id="sentence2eng"></span>
</p><p>
<span class="prose" id="sentence3"></span>
<span class="trans" id="sep3"></span>
<span class="trans" id="sentence3eng"></span>
</p>
<div id="postlude">
<p>Now you can think about what these sentences might mean. To see the English translations, click the button below.</p>
</div>
<button onclick="show2()">Toggle translations</button>
</div>
<script>
/*Nouns*/
var barenouns = ["den", "benyn", "maw", "mowes", "bord", "beister", "cota", "cath", "daras", "davas", "gwely", "gwedhen", "keus", "kenter", "morthol", "melwhen", "podik", "pel", "tan", "tesen", "kei", "kist", "cador", "cador vregh", "chei", "chymbla", "cornel", "coweth", "cunys", "daffar", "cres", "esedhva", "fos", "kegin", "knouk", "lestrier", "oles", "portal", "roum", "tal", "tenewen", "benk", "boos", "coffy", "dowr", "estyllen", "forn", "golgher lestry", "gwreg", "oyl", "rewer", "somf", "sugra", "talgel", "tap", "te", "yeyner"];
var getRandomNoun = function () {
return barenouns[Math.floor(Math.random() * barenouns.length)];
};
var testword = getRandomNoun();
var nounlist = {
"nouns":[
{"cornish":"den","gender":"m","english":"man","engpl":"men",},
{"cornish":"benyn","gender":"f","english":"woman","engpl":"women",},
{"cornish":"maw","gender":"m","english":"boy","engpl":null,},
{"cornish":"mowes","gender":"f","english":"girl","engpl":null,},
{"cornish":"bord","gender":"m","english":"table","engpl":null,},
{"cornish":"beister","gender":"f","english":"window","engpl":null,},
{"cornish":"cota","gender":"m","english":"coat","engpl":null,},
{"cornish":"cath","gender":"f","english":"cat","engpl":null,},
{"cornish":"daras","gender":"m","english":"door","engpl":null,},
{"cornish":"davas","gender":"f","english":"sheep","engpl":"sheep",},
{"cornish":"gwely","gender":"m","english":"bed","engpl":null,},
{"cornish":"gwedhen","gender":"f","english":"tree","engpl":null,},
{"cornish":"keus","gender":"m","english":"cheese","engpl":null,},
{"cornish":"kenter","gender":"f","english":"nail","engpl":null,},
{"cornish":"morthol","gender":"m","english":"hammer","engpl":null,},
{"cornish":"melwhen","gender":"f","english":"slug","engpl":null,},
{"cornish":"podik","gender":"m","english":"jug","engpl":null,},
{"cornish":"pel","gender":"f","english":"ball","engpl":null,},
{"cornish":"tan","gender":"m","english":"fire","engpl":null,},
{"cornish":"tesen","gender":"f","english":"biscuit","engpl":null,},
{"cornish":"kei","gender":"m","english":"dog","engpl":null,},
{"cornish":"kist","gender":"f","english":"box","engpl":"boxes",},
{"cornish":"cador","gender":"f","english":"chair","engpl":null,},
{"cornish":"cador vregh","gender":"f","english":"armchair","engpl":null,},
{"cornish":"chei","gender":"m","english":"house","engpl":null,},
{"cornish":"chymbla","gender":"m","english":"chimney","engpl":null,},
{"cornish":"cornel","gender":"f","english":"corner","engpl":null,},
{"cornish":"coweth","gender":"m","english":"friend","engpl":null,},
{"cornish":"cunys","gender":"m","english":"firewood","engpl":"coll",},
{"cornish":"daffar","gender":"m","english":"equipment","engpl":"coll",},
{"cornish":"cres","gender":"m","english":"middle","engpl":null,},
{"cornish":"esedhva","gender":"m","english":"living room","engpl":null,},
{"cornish":"fos","gender":"f","english":"wall","engpl":null,},
{"cornish":"kegin","gender":"f","english":"kitchen","engpl":null,},
{"cornish":"knouk","gender":"m","english":"knock","engpl":null,},
{"cornish":"lestrier","gender":"m","english":"dresser","engpl":null,},
{"cornish":"oles","gender":"f","english":"hearth","engpl":null,},
{"cornish":"portal","gender":"m","english":"porch","engpl":"porches",},
{"cornish":"roum","gender":"m","english":"room","engpl":null,},
{"cornish":"tal","gender":"f","english":"front","engpl":null,},
{"cornish":"tenewen","gender":"m","english":"side","engpl":null,},
{"cornish":"benk","gender":"m","english":"workbench","engpl":"workbenches",},
{"cornish":"boos","gender":"m","english":"food","engpl":"coll",},
{"cornish":"coffy","gender":"m","english":"coffee","engpl":"coll",},
{"cornish":"dowr","gender":"m","english":"water","engpl":"coll",},
{"cornish":"estyllen","gender":"f","english":"shelf","engpl":"shelves",},
{"cornish":"forn","gender":"f","english":"oven","engpl":null,},
{"cornish":"golgher lestry","gender":"m","english":"dishwasher","engpl":null,},
{"cornish":"gwreg","gender":"f","english":"wife","engpl":"wives",},
{"cornish":"oyl","gender":"m","english":"oil","engpl":"coll",},
{"cornish":"rewer","gender":"m","english":"freezer","engpl":null,},
{"cornish":"somf","gender":"m","english":"sink","engpl":null,},
{"cornish":"sugra","gender":"m","english":"sugar","engpl":"coll",},
{"cornish":"talgel","gender":"f","english":"pantry","engpl":"pantries",},
{"cornish":"tap","gender":"m","english":"tap","engpl":null,},
{"cornish":"te","gender":"m","english":"tea","engpl":"coll",},
{"cornish":"yeyner","gender":"m","english":"fridge","engpl":null,},
],
};
var engversion = {};
nounlist.nouns.forEach(function (item) {
engversion[item.cornish] = item.english;
});
var gramgender = {};
nounlist.nouns.forEach(function (item) {
gramgender[item.cornish] = item.gender;
});
var engversionpl = {};
nounlist.nouns.forEach(function (item) {
if (item.engpl == null) {
engversionpl[item.cornish] = item.english + "s";
} else if (item.engpl == "coll") {
engversionpl[item.cornish] = "sets of " + item.english;
} else {
engversionpl[item.cornish] = item.engpl;
}
});
var testwordengpl = engversionpl[testword];
var testwordeng = engversion[testword];
var testwordgender = gramgender[testword];
document.getElementById("nouncorn").innerHTML = "Noun: " + testword;
document.getElementById("nouneng").innerHTML = "English: " + testwordeng;
document.getElementById("noungender").innerHTML = "Gender: " + testwordgender;
document.getElementById("nounengpl").innerHTML = "English plural: " + testwordengpl;
/*Adjectives*/
var bareadjs = ["berr", "cott", "hir", "coth", "nowedh", "yonk", "skianjek", "sogh", "lebm", "es", "medhel", "calish", "broas", "bian", "meur", "wheg", "wherow", "trenk", "sellys", "gwydn", "du", "munys", "scav", "poos", "tanow", "pals", "crev", "gwadn", "da", "drog", "glan", "plos", "teg", "ydn", "ledan", "lowen", "truedhek", "spladn", "tewl", "fur", "gocky", "ughel", "isel", "gwir", "anwir", "tobm", "yeyn", "clys", "goles", "ygerys", "cro", "tredanek", "vas"];
var getRandomAdj = function () {
return bareadjs[Math.floor(Math.random() * bareadjs.length)];
};
var testadj = getRandomAdj();
var adjlist = {
"adjs":[
{"cornish":"berr","english":"short",},
{"cornish":"cott","english":"brief",},
{"cornish":"hir","english":"long",},
{"cornish":"coth","english":"old",},
{"cornish":"nowedh","english":"new",},
{"cornish":"yonk","english":"young",},
{"cornish":"skianjek","english":"intelligent",},
{"cornish":"sogh","english":"blunt",},
{"cornish":"lebm","english":"sharp",},
{"cornish":"es","english":"easy",},
{"cornish":"medhel","english":"soft",},
{"cornish":"calish","english":"hard",},
{"cornish":"broas","english":"big",},
{"cornish":"bian","english":"small",},
{"cornish":"meur","english":"great",},
{"cornish":"wheg","english":"sweet",},
{"cornish":"wherow","english":"bitter",},
{"cornish":"trenk","english":"sour",},
{"cornish":"sellys","english":"salty",},
{"cornish":"gwydn","english":"white",},
{"cornish":"du","english":"black",},
{"cornish":"munys","english":"tiny",},
{"cornish":"scav","english":"light",},
{"cornish":"poos","english":"heavy",},
{"cornish":"tanow","english":"scarce",},
{"cornish":"pals","english":"plentiful",},
{"cornish":"crev","english":"strong",},
{"cornish":"gwadn","english":"weak",},
{"cornish":"da","english":"good",},
{"cornish":"drog","english":"bad",},
{"cornish":"glan","english":"clean",},
{"cornish":"plos","english":"dirty",},
{"cornish":"teg","english":"pretty",},
{"cornish":"ydn","english":"narrow",},
{"cornish":"ledan","english":"wide",},
{"cornish":"lowen","english":"happy",},
{"cornish":"truedhek","english":"sad",},
{"cornish":"spladn","english":"bright",},
{"cornish":"tewl","english":"dark",},
{"cornish":"tobm","english":"hot",},
{"cornish":"yeyn","english":"cold",},
{"cornish":"fur","english":"sensible",},
{"cornish":"gocky","english":"silly",},
{"cornish":"ughel","english":"high",},
{"cornish":"gwir","english":"true",},
{"cornish":"anwir","english":"untrue",},
{"cornish":"isel","english":"low",},
{"cornish":"clys","english":"comfortable",},
{"cornish":"goles","english":"low",},
{"cornish":"ygerys","english":"open",},
{"cornish":"cro","english":"fresh",},
{"cornish":"tredanek","english":"electric",},
{"cornish":"vas","english":"serviceable",},
],
};
var engversionadj = {};
adjlist.adjs.forEach(function (item) {
engversionadj[item.cornish] = item.english;
});
var testadjeng = engversionadj[testadj];
document.getElementById("adjcorn").innerHTML = "Adjective: " + testadj;
document.getElementById("adjeng").innerHTML = "English: " + testadjeng;
/*Numbers*/
var barenumbs = ["udn","dew","trei","pajar","pemp","whegh","seyth","eth","naw","deg"];
var getRandomNumb = function () {
return barenumbs[Math.floor(Math.random() * barenumbs.length)];
};
var testnumb = getRandomNumb();
var numblist = {
"numbs":[
{"cornish":"udn","english":"one","fem":null,"digit":"1",},
{"cornish":"dew","english":"two","fem":"diw","digit":"2",},
{"cornish":"trei","english":"three","fem":"teyr","digit":"3",},
{"cornish":"pajar","english":"four","fem":"peder","digit":"4",},
{"cornish":"pemp","english":"five","fem":null,"digit":"5",},
{"cornish":"whegh","english":"six","fem":null,"digit":"6",},
{"cornish":"seyth","english":"seven","fem":null,"digit":"7",},
{"cornish":"eth","english":"eight","fem":null,"digit":"8",},
{"cornish":"naw","english":"nine","fem":null,"digit":"9",},
{"cornish":"deg","english":"ten","fem":null,"digit":"10",},
],
};
var engversionnumb = {};
numblist.numbs.forEach(function (item) {
engversionnumb[item.cornish] = item.english;
});
var testnumbeng = engversionnumb[testnumb];
var digitnumb = {};
numblist.numbs.forEach(function (item) {
digitnumb[item.cornish] = item.digit;
});
var testdigit = digitnumb[testnumb];
var femversionnumb = {};
numblist.numbs.forEach(function (item) {
if (item.fem == null) {
femversionnumb[item.cornish] = item.cornish;
} else {
femversionnumb[item.cornish] = item.fem;
}
});
var testnumbfem = femversionnumb[testnumb];
document.getElementById("numbcorn").innerHTML = "Cornish: " + testnumb;
document.getElementById("numbeng").innerHTML = "English: " + testnumbeng;
document.getElementById("numbfem").innerHTML = "Feminine: " + testnumbfem;
document.getElementById("digit").innerHTML = "Number: " + testdigit;
/*Pick number to use*/
var numbuse = {};
if (testwordgender == "f") {
numbuse = testnumbfem;
} else {
numbuse = testnumb;
};
document.getElementById("numbuse").innerHTML = "Use this number: " + numbuse;
/*Lenition*/
function lenition(stringo) {
if (stringo.startsWith("ch")) {
var res = stringo;
} else if (stringo.startsWith("gh")) {
var res = stringo;
} else if (stringo.startsWith("dh")) {
var res = stringo;
} else if (stringo.startsWith("th")) {
var res = stringo;
} else if (stringo.startsWith("go")) {
var res = "w" + stringo.slice(1);
} else if (stringo.startsWith("gu")) {
var res = "w" + stringo.slice(1);
} else if (stringo.charAt(0) == "b") {
var res = "v" + stringo.slice(1);
} else if (stringo.charAt(0) == "c") {
var res = "g" + stringo.slice(1);
} else if (stringo.charAt(0) == "d") {
var res = "dh" + stringo.slice(1);
} else if (stringo.charAt(0) == "g") {
var res = stringo.slice(1);
} else if (stringo.charAt(0) == "k") {
var res = "g" + stringo.slice(1);
} else if (stringo.charAt(0) == "m") {
var res = "v" + stringo.slice(1);
} else if (stringo.charAt(0) == "p") {
var res = "b" + stringo.slice(1);
} else if (stringo.charAt(0) == "t") {
var res = "d" + stringo.slice(1);
} else {
var res = stringo;
};
return res;
};
var lennoun = lenition(testword);
var lenadj = lenition(testadj);
var lennumb = lenition(numbuse);
document.getElementById("nounlen").innerHTML = "Lenited: " + lennoun;
document.getElementById("adjlen").innerHTML = "Lenited: " + lenadj;
document.getElementById("numblen").innerHTML = "Lenited: " + lennumb;
/*For beginning sentences*/
function firstcap(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
/*Sentences*/
/*An NOUN ew ADJ.*/
var anew = {};
if (testwordgender == "f") {
anew = "An " + lennoun + " ew " + testadj + ".";
} else {
anew = "An " + testword + " ew " + testadj + ".";
};
var aneweng = "The " + testwordeng + " is " + testadjeng + ".";
document.getElementById("sentence1").innerHTML = anew;
document.getElementById("sentence1eng").innerHTML = aneweng;
/*NOUN ADJ ew.*/
var xyew = {};
if (testwordgender == "f") {
xyew = firstcap(testword) + " " + lenadj + " ew.";
} else {
xyew = firstcap(testword) + " " + testadj + " ew.";
};
var engpronoun = {}
if (testword == "den") {
engpronoun = "Hes";
} else if (testword == "maw") {
engpronoun = "Hes";
} else if (testword == "benyn") {
engpronoun = "Shes";
} else if (testword == "mowes") {
engpronoun = "Shes";
} else {
engpronoun = "Its";
};
var engindef = {}
if (testadjeng.charAt(0) == "a") {
engindef = "an";
} else if (testadjeng.charAt(0) == "e") {
engindef = "an";
} else if (testadjeng.charAt(0) == "i") {
engindef = "an";
} else if (testadjeng.charAt(0) == "o") {
engindef = "an";
} else if (testadjeng.charAt(0) == "u") {
engindef = "an";
} else {
engindef = "a";
};
var xyeweng = {}
if (testwordengpl.startsWith("sets of")) {
xyeweng = engpronoun + " " + testadjeng + " " + testwordeng + ".";
} else {
xyeweng = engpronoun + " " + engindef + " " + testadjeng + " " + testwordeng + ".";
};
document.getElementById("sentence2").innerHTML = xyew;
document.getElementById("sentence2eng").innerHTML = xyeweng;
/*Ma NUM NOUN.*/
var udnnoun = {};
if (testwordgender == "f") {
udnnoun = lennoun;
} else {
udnnoun = testword;
};
var ma0 = {};
if (testnumb == "udn") {
ma0 = "Ma udn " + udnnoun + ".";
} else if (testnumb == "dew") {
ma0 = "Ma " + numbuse + " " + lennoun + ".";
} else {
ma0 = "Ma " + numbuse + " " + testword + ".";
};
var ma0eng = {};
if (testnumb == "udn") {
if (testwordengpl.startsWith("sets of")) {
ma0eng = "There is one set of " + testwordeng + ".";
} else {
ma0eng = "There is one " + testwordeng + ".";
};
} else {
ma0eng = "There are " + testnumbeng + " " + testwordengpl + ".";
};
document.getElementById("sentence3").innerHTML = ma0;
document.getElementById("sentence3eng").innerHTML = ma0eng;
</script>
</body>
</html>
Loading…
Cancel
Save