You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cornish-js/samplesentences.html

497 lines
18 KiB
HTML

5 years ago
<!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">
<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>