-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathemilySymbols.js
69 lines (66 loc) · 1.78 KB
/
emilySymbols.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var emSymbols = {
"FPBL": "↑←→↓",
"FR": "!¬↦¡",
"FP": "\"“”„",
"FRLG": "#©®™",
"RPBL": "$¥€£",
"FRPB": "%‰‱φ",
"FBG": "&∩∧∈",
"F": "'‘’‚",
"FPL": "([<{",
"RBG": ")}>}",
"L": "*∏§×",
"G": "+∑¶±",
"B": ",∪∨∉",
"PL": "-−–—",
"R": ".•·…",
"RP": "/⇒⇔÷",
"LG": ":∋∵∴",
"RB": ";∀∃∄",
"PBLG": "=≡≈≠",
"FPB": "?¿∝‽",
"FRPBLG": "@⊕⊗∅",
"FB": "\\Δ√∞",
"RPG": "^«»°",
"BG": "_≤≥µ",
"P": "`⊂⊃π",
"FPBG": "~⊆⊇˜"
}
var emGenerated = {};
var emGeneratedKeyList = [];
var variants=["", "E", "U", "EU"];
//Generate all strokes
for(var symStroke in emSymbols){ //Symbol rows / all symbols
var symbols = emSymbols[symStroke];
for(var i = 0; i < 4; i++){ //Symbols / symbol rows
var symbol = symbols[i];
var variantStroke = variants[i];
var stroke = "SKWHAO-"+variantStroke+symStroke;
emGenerated[stroke] = symbol;
TypeJig.Translations.Plover[symbol] = stroke;
emGeneratedKeyList.push(stroke);
}
};
console.log(emGenerated);
function generate_exercise(sym_count, rnd) {
let words = []
for(var i = 0; i < sym_count; i++){
var index = Math.floor(emGeneratedKeyList.length * rnd());
var randomStroke = emGeneratedKeyList[index];
var randomSymbol = emGenerated[randomStroke];
words.push(randomSymbol);
}
console.log(words);
return new TypeJig.Exercise(words, 0, false, 'ordered');
}
let jig
window.addEventListener('load', () => jig = loadExercisePage(args => {
const nwords = args.word_count==null ? 100 : parseInt(args.word_count)
//console.log(nwords + " symbols");
console.log("Strokes: ");
console.log(TypeJig.Translations.Plover);
return {
generate: (rnd, options) => generate_exercise(nwords, rnd),
options: { name: "Emily's Symbol Dictionary" }
}
}))