config.js (3356B)
1 import kimchiFrequency from "../data/kimchi-verb-frequencies.js"; 2 import "./types.js"; 3 4 /** 5 * @returns {Config} config 6 */ 7 export function loadConfig() { 8 const persistentConfig = localStorage.getItem("config"); 9 if (persistentConfig) { 10 return JSON.parse(persistentConfig); 11 } 12 13 return { 14 tenses: JSON.parse(JSON.stringify(DEFAULT_CONFIG.tenses)), 15 datasets: { ...DEFAULT_CONFIG.datasets }, 16 }; 17 } 18 19 /** @type {Config} */ 20 export const DEFAULT_CONFIG = { 21 tenses: { 22 "declarative present informal low": { enabled: true, example: "해" }, 23 "declarative present informal high": { enabled: true, example: "해요" }, 24 "declarative present formal low": { enabled: false, example: "한다" }, 25 "declarative present formal high": { enabled: true, example: "합니다" }, 26 "declarative past informal low": { enabled: true, example: "했어" }, 27 "declarative past informal high": { enabled: true, example: "했어요" }, 28 "declarative past formal low": { enabled: false, example: "했다" }, 29 "declarative past formal high": { enabled: true, example: "했습니다" }, 30 "declarative future informal low": { enabled: true, example: "할 거야" }, 31 "declarative future informal high": { enabled: true, example: "할 거예요" }, 32 "declarative future formal low": { enabled: false, example: "할 거다" }, 33 "declarative future formal high": { enabled: true, example: "할 겁니다" }, 34 "declarative future conditional informal low": { 35 enabled: false, 36 example: "하겠어", 37 }, 38 "declarative future conditional informal high": { 39 enabled: false, 40 example: "하겠어요", 41 }, 42 "declarative future conditional formal low": { 43 enabled: false, 44 example: "하겠다", 45 }, 46 "declarative future conditional formal high": { 47 enabled: false, 48 example: "하겠습니다", 49 }, 50 "inquisitive present informal low": { enabled: true, example: "해?" }, 51 "inquisitive present informal high": { enabled: true, example: "해요?" }, 52 "inquisitive present formal low": { enabled: false, example: "하니?" }, 53 "inquisitive present formal high": { enabled: true, example: "합니까?" }, 54 "inquisitive past informal low": { enabled: true, example: "했어?" }, 55 "inquisitive past informal high": { enabled: true, example: "했어요?" }, 56 "inquisitive past formal low": { enabled: false, example: "했니?" }, 57 "inquisitive past formal high": { enabled: true, example: "했습니까?" }, 58 "imperative present informal low": { enabled: false, example: "해" }, 59 "imperative present informal high": { enabled: true, example: "하세요" }, 60 "imperative present formal low": { enabled: false, example: "해라" }, 61 "imperative present formal high": { enabled: false, example: "하십시오" }, 62 "propositive present informal low": { enabled: false, example: "해" }, 63 "propositive present informal high": { enabled: false, example: "해요" }, 64 "propositive present formal low": { enabled: false, example: "하자" }, 65 "propositive present formal high": { enabled: false, example: "합시다" }, 66 "connective if": { enabled: false, example: "하면" }, 67 "connective and": { enabled: false, example: "하고" }, 68 "nominal ing": { enabled: false, example: "함" }, 69 }, 70 datasets: { 71 kimchiFrequency: { 72 enabled: true, 73 name: "Kimchi Reader most frequent words", 74 dataset: kimchiFrequency, 75 isCustom: false, 76 }, 77 }, 78 };