From e88ebee7c80995763c3576a6bfff9664eee09692 Mon Sep 17 00:00:00 2001 From: Thiago Chaves Date: Thu, 28 Jul 2022 17:05:33 +0300 Subject: [PATCH] Remove 'mock data' word entries, replace with smaller initial data --- src/mock/kivi.ts | 6 -- src/mock/mock-data.ts | 156 -------------------------------------- src/mock/puhua.ts | 5 -- src/model/database.ts | 4 +- src/model/initial-data.ts | 86 +++++++++++++++++++++ 5 files changed, 88 insertions(+), 169 deletions(-) delete mode 100644 src/mock/kivi.ts delete mode 100644 src/mock/mock-data.ts delete mode 100644 src/mock/puhua.ts create mode 100644 src/model/initial-data.ts diff --git a/src/mock/kivi.ts b/src/mock/kivi.ts deleted file mode 100644 index f8100c9..0000000 --- a/src/mock/kivi.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Retrieved on 2022.07.23 from: -// https://en.wiktionary.org/w/api.php?action=parse&format=json&prop=text&page=kivi -// and dumped using python3 raw strings - -export const KiviRaw: string = - '
\\n

Contents

\\n\\n
\\n\\n

Czech[edit]

\\n

Etymology[edit]

\\n

From Maori kiwi.\\n

\\n

Pronunciation[edit]

\\n\\n

Noun[edit]

\\n

kivi m\\n

\\n
  1. kiwi (flightless bird of the genus Apteryx, native to New Zealand)
\\n

Further reading[edit]

\\n\\n
\\n

Estonian[edit]

\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi, from Proto-Finno-Ugric *kiwe. Cognate with Finnish kivi, Hungarian k\\u0151.\\n

\\n

Noun[edit]

\\n

kivi (genitive kivi, partitive kivi)\\n

\\n
  1. stone, rock
  2. \\n
  3. (slang) hashish\\n
    Synonym: ha\\u0161i\\u0161
  4. \\n
  5. (slang) cannabis, weed
\\n

Declension[edit]

\\n
\\n
Inflection of kivi (\\u00d5S type 17e/kivi, no gradation)
\\n
\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
\\nsingular\\nplural\\n
nominative\\nkivi\\nkivid\\n
accusative\\nkivi\\nkivid\\n
genitive\\nkivi\\nkivide\\n
partitive\\nkivi\\nkive
kivisid\\n
illative\\nkivvi
kivisse\\n
kividesse
kivesse\\n
inessive\\nkivis\\nkivides
kives\\n
elative\\nkivist\\nkividest
kivest\\n
allative\\nkivile\\nkividele
kivele\\n
adessive\\nkivil\\nkividel
kivel\\n
ablative\\nkivilt\\nkividelt
kivelt\\n
translative\\nkiviks\\nkivideks
kiveks\\n
terminative\\nkivini\\nkivideni\\n
essive\\nkivina\\nkividena\\n
abessive\\nkivita\\nkivideta\\n
comitative\\nkiviga\\nkividega\\n
\\n
\\n
\\n

Derived terms[edit]

\\n\\n

References[edit]

\\n\\n
\\n

Finnish[edit]

\\n
\\"\\"
Finnish Wikipedia has an article on:
kivi
Wikipedia fi
\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi, from Proto-Finno-Ugric *kiwe.\\n

\\n

Pronunciation[edit]

\\n\\n

Noun[edit]

\\n

kivi\\n

\\n
  1. stone
  2. \\n
  3. a piece of stone which is larger than a grain of sand
  4. \\n
  5. a rock as a relatively small mass of stone projecting out of ground
  6. \\n
  7. boulder\\n
    Synonyms: lohkare, kivenlohkare, siirtolohkare
  8. \\n
  9. a general term for solid, mineral-based construction materials, such as brick, concrete or natural stone
  10. \\n
  11. (nautical, informal) an underwater rock which may be dangerous for seafarers\\n
    Synonym: kari
  12. \\n
  13. Short for jalokivi (\\u201crock, jewel\\u201d).\\n
    T\\u00e4ss\\u00e4 kellossa on 17 kive\\u00e4. \\u2015 This clockwork mechanism is made with 17 jewels.
    \\n
    Katso tuota kive\\u00e4 h\\u00e4nen sormessaan! \\u2015 Look at that rock on her finger!
  14. \\n
  15. (colloquial, snooker, pool, billiards) cue ball\\n
    Synonym: ly\\u00f6ntipallo
  16. \\n
  17. (colloquial, computer hardware) central processing unit
\\n

Declension[edit]

\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Inflection of kivi (Kotus type 7/ovi, no gradation)\\n
nominative\\nkivi\\nkivet\\n
genitive\\nkiven\\nkivien\\n
partitive\\nkive\\u00e4\\nkivi\\u00e4\\n
illative\\nkiveen\\nkiviin\\n
\\nsingular\\nplural\\n
nominative\\nkivi\\nkivet\\n
accusative\\nnom.\\nkivi\\nkivet\\n
gen.\\nkiven\\n
genitive\\nkiven\\nkivien\\n
partitive\\nkive\\u00e4\\nkivi\\u00e4\\n
inessive\\nkivess\\u00e4\\nkiviss\\u00e4\\n
elative\\nkivest\\u00e4\\nkivist\\u00e4\\n
illative\\nkiveen\\nkiviin\\n
adessive\\nkivell\\u00e4\\nkivill\\u00e4\\n
ablative\\nkivelt\\u00e4\\nkivilt\\u00e4\\n
allative\\nkivelle\\nkiville\\n
essive\\nkiven\\u00e4\\nkivin\\u00e4\\n
translative\\nkiveksi\\nkiviksi\\n
instructive\\n—\\nkivin\\n
abessive\\nkivett\\u00e4\\nkivitt\\u00e4\\n
comitative\\n—\\nkivineen\\n
\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Possessive forms of kivi (type ovi)\\n
possessor\\nsingular\\nplural\\n
1st person\\nkiveni\\nkivemme\\n
2nd person\\nkivesi\\nkivenne\\n
3rd person\\nkivens\\u00e4\\n
\\n

Derived terms[edit]

\\n\\n

Compounds[edit]

\\n
\\n
 
\\n

Usage notes[edit]

\\n

A large mass of stone projecting out of ground is called kallio. Also, if the stone mass is known or assumed to be part of bedrock, it\'s called kallio, even if the visible part is small. Similarly, if a large stone mass is known not to be part of bedrock, it may be called kivi or lohkare.\\n

\\n

References[edit]

\\n


\\n

\\n
\\n

Hungarian[edit]

\\n

Pronunciation[edit]

\\n\\n

Etymology 1[edit]

\\n

From English kiwi, from Maori kiwi.\\n

\\n

Noun[edit]

\\n

kivi (plural kivik)\\n

\\n
  1. kiwi (flightless bird of the genus Apteryx)
  2. \\n
  3. kiwi fruit (Chinese gooseberry vine fruit)
\\n
Declension[edit]
\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Inflection (stem in long/high vowel, front unrounded harmony)\\n
\\nsingular\\nplural\\n
nominative\\nkivi\\nkivik\\n
accusative\\nkivit\\nkiviket\\n
dative\\nkivinek\\nkiviknek\\n
instrumental\\nkivivel\\nkivikkel\\n
causal-final\\nkivi\\u00e9rt\\nkivik\\u00e9rt\\n
translative\\nkiviv\\u00e9\\nkivikk\\u00e9\\n
terminative\\nkiviig\\nkivikig\\n
essive-formal\\nkivik\\u00e9nt\\nkivikk\\u00e9nt\\n
essive-modal\\n—\\n—\\n
inessive\\nkiviben\\nkivikben\\n
superessive\\nkivin\\nkiviken\\n
adessive\\nkivin\\u00e9l\\nkivikn\\u00e9l\\n
illative\\nkivibe\\nkivikbe\\n
sublative\\nkivire\\nkivikre\\n
allative\\nkivihez\\nkivikhez\\n
elative\\nkivib\\u0151l\\nkivikb\\u0151l\\n
delative\\nkivir\\u0151l\\nkivikr\\u0151l\\n
ablative\\nkivit\\u0151l\\nkivikt\\u0151l\\n
non-attributive
possessive - singular
\\n
kivi\\u00e9\\nkivik\\u00e9\\n
non-attributive
possessive - plural
\\n
kivi\\u00e9i\\nkivik\\u00e9i\\n
\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Possessive forms of kivi\\n
possessor\\nsingle possession\\nmultiple possessions\\n
1st person sing.\\nkivim\\nkivijeim\\n
2nd person sing.\\nkivid\\nkivijeid\\n
3rd person sing.\\nkivije\\nkivijei\\n
1st person plural\\nkivink\\nkivijeink\\n
2nd person plural\\nkivitek\\nkivijeitek\\n
3rd person plural\\nkivij\\u00fck\\nkivijeik\\n
\\n
Derived terms[edit]
\\n\\n
Compound words
\\n

Etymology 2[edit]

\\n

Clipping and -i diminutive of k\\u00edv\\u00e1ncsi (\\u201ccurious\\u201d).\\n

\\n

Adjective[edit]

\\n

kivi (not comparable)\\n

\\n
  1. (informal) curious (tending to ask questions)\\n
    Synonym: k\\u00edv\\u00e1ncsi
\\n
Declension[edit]
\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Inflection (stem in long/high vowel, front unrounded harmony)\\n
\\nsingular\\nplural\\n
nominative\\nkivi\\nkivik\\n
accusative\\nkivit\\nkiviket\\n
dative\\nkivinek\\nkiviknek\\n
instrumental\\nkivivel\\nkivikkel\\n
causal-final\\nkivi\\u00e9rt\\nkivik\\u00e9rt\\n
translative\\nkiviv\\u00e9\\nkivikk\\u00e9\\n
terminative\\nkiviig\\nkivikig\\n
essive-formal\\nkivik\\u00e9nt\\nkivikk\\u00e9nt\\n
essive-modal\\n—\\n—\\n
inessive\\nkiviben\\nkivikben\\n
superessive\\nkivin\\nkiviken\\n
adessive\\nkivin\\u00e9l\\nkivikn\\u00e9l\\n
illative\\nkivibe\\nkivikbe\\n
sublative\\nkivire\\nkivikre\\n
allative\\nkivihez\\nkivikhez\\n
elative\\nkivib\\u0151l\\nkivikb\\u0151l\\n
delative\\nkivir\\u0151l\\nkivikr\\u0151l\\n
ablative\\nkivit\\u0151l\\nkivikt\\u0151l\\n
non-attributive
possessive - singular
\\n
kivi\\u00e9\\nkivik\\u00e9\\n
non-attributive
possessive - plural
\\n
kivi\\u00e9i\\nkivik\\u00e9i\\n
\\n
\\n

Ingrian[edit]

\\n
\\"\\"
Kivi.
\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi, from Proto-Finno-Ugric *kiwe. Cognates include Finnish kivi and Estonian kivi.\\n

\\n

Pronunciation[edit]

\\n\\n

Noun[edit]

\\n

kivi (genitive kiven, partitive kivvi\\u00e4)\\n

\\n
  1. stone, rock
\\n

Declension[edit]

\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Declension of kivi (type 5/lehti, no gradation, gemination)\\n
\\nsingular\\nplural\\n
nominative\\nkivi\\nkivet\\n
genitive\\nkiven\\nkivviin, kivil\\u00f6in\\n
partitive\\nkivvi\\u00e4\\nkivvij\\u00e4, kivil\\u00f6j\\u00e4\\n
illative\\nkivvee\\nkivvii, kivil\\u00f6ihe\\n
inessive\\nkives\\nkivis, kivil\\u00f6is\\n
elative\\nkivest\\nkivist, kivil\\u00f6ist\\n
allative\\nkivelle\\nkiville, kivil\\u00f6ille\\n
adessive\\nkivel\\nkivil, kivil\\u00f6il\\n
ablative\\nkivelt\\nkivilt, kivil\\u00f6ilt\\n
translative\\nkiveks\\nkiviks, kivil\\u00f6iks\\n
essive\\nkivenn\\u00e4, kivveen\\nkivinn\\u00e4, kivil\\u00f6inn\\u00e4, kivviin, kivil\\u00f6iheen\\n
exessive1)\\nkivent\\nkivint, kivil\\u00f6int\\n
1) obsolete
*) the accusative corresponds with either the genitive (sg) or nominative (pl)
**) the comitative is formed by adding the suffix -ka? or -k\\u00e4? to the genitive.\\n
\\n

Derived terms[edit]

\\n\\n

References[edit]

\\n\\n
\\n

Karelian[edit]

\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi, from Proto-Finno-Ugric *kiwe. Cognate with Finnish kivi, Hungarian k\\u0151.\\n

\\n

Noun[edit]

\\n

kivi (genitive kiven, partitive kivie)\\n

\\n
  1. stone
\\n
\\n

Latvian[edit]

\\n
\\"Wikipedia-logo.png\\"
 kivi (1) on Latvian Wikipedia
\\n

Etymology[edit]

\\n
\\"\\"
Kivi (1)
\\n

Via other European languages, ultimately borrowed from Maori kiwi, originally an onomatopoeic imitation of the bird\'s call. Originally the name of the bird, the English word kiwi soon became a term for people and things from New Zealand, and was thus also used, initially as a brand name, for the fruit, which is also from New Zealand.\\n

\\n

Pronunciation[edit]

\\n\\n

Noun[edit]

\\n
\\"Wikipedia-logo.png\\"
 kivi (2) on Latvian Wikipedia
\\n
\\"\\"
Kivi (2)
\\n

kivi m (invariable)\\n

\\n
  1. kiwi bird (a flightless bird (genus Apteryx) found only in New Zealand)\\n
    kivi dzimta \\u2015 kiwi family (Apterygidae)
    \\n
    kivi ir putni, kas dz\\u012bvo tikai Jaunz\\u0113land\\u0113 \\u2015 the kiwi are birds that live only in New Zealand
  2. \\n
  3. kiwi fruit (a Chinese gooseberry vine fruit of the genus Actinidia with hairy brown skin and dark green flesh)\\n
    kivi ir subtropu auglis ar br\\u016bnu, p\\u016bkainu mizu un za\\u013cu m\\u012bkstumu \\u2015 the kiwi is a subtropical fruit with brown, hairy skin and green flesh
    \\n
    kivi p\\u0113c formas atg\\u0101dina olu \\u2015 the kiwi is shaped like an egg
\\n

See also[edit]

\\n\\n
\\n

Ludian[edit]

\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi.\\n

\\n

Noun[edit]

\\n

kivi\\n

\\n
  1. stone
\\n
\\n

Norwegian Bokm\\u00e5l[edit]

\\n
\\"\\"
Norwegian Wikipedia has an article on:
Kivier
Wikipedia no
\\n

Etymology[edit]

\\n

From Maori kiwi.\\n

\\n

Noun[edit]

\\n

kivi m (definite singular kivien, indefinite plural kivier, definite plural kiviene)\\n

\\n
  1. a kiwi (flightless bird native to New Zealand)
\\n

See also[edit]

\\n\\n

References[edit]

\\n\\n
\\n

Norwegian Nynorsk[edit]

\\n
\\"\\"
Norwegian Nynorsk Wikipedia has an article on:
Kiviar
Wikipedia nn
\\n

Etymology[edit]

\\n

From Maori kiwi.\\n

\\n

Noun[edit]

\\n

kivi m (definite singular kivien, indefinite plural kiviar, definite plural kiviane)\\n

\\n
  1. a kiwi (flightless bird native to New Zealand)
\\n

See also[edit]

\\n\\n

References[edit]

\\n\\n
\\n

Rarotongan[edit]

\\n

Etymology[edit]

\\n

Borrowed from Maori kiwi.\\n

\\n

Noun[edit]

\\n

kivi\\n

\\n
  1. kiwi
\\n

Serbo-Croatian[edit]

\\n

Etymology[edit]

\\n

From Maori kiwi.\\n

\\n

Noun[edit]

\\n

k\\u020bvi m (Cyrillic spelling \\u043a\\u0438\\u0311\\u0432\\u0438)\\n

\\n
  1. kiwi fruit
\\n

Declension[edit]

\\n

This entry needs an inflection-table template.

\\n
\\n

Turkish[edit]

\\n

Etymology[edit]

\\n

From English kiwi, from Maori kiwi.\\n

\\n

Noun[edit]

\\n

kivi (definite accusative kivii, plural kiviler)\\n

\\n
  1. kiwi (animal)
  2. \\n
  3. kiwi fruit
\\n

References[edit]

\\n\\n
\\n

Veps[edit]

\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi, from Proto-Finno-Ugric *kiwe.\\n

\\n

Noun[edit]

\\n

kivi\\n

\\n
  1. stone, rock
\\n

Inflection[edit]

\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Inflection of kivi\\n
nominative sing.\\nkivi\\n
genitive sing.\\nkiven\\n
partitive sing.\\nkived\\n
partitive plur.\\nkivid\\n
\\nsingular\\nplural\\n
nominative\\nkivi\\nkived\\n
accusative\\nkiven\\nkived\\n
genitive\\nkiven\\nkividen\\n
partitive\\nkived\\nkivid\\n
essive-instructive\\nkiven\\nkivin\\n
translative\\nkiveks\\nkivik\\u0161\\n
\\n
inessive\\nkives\\nkivi\\u0161\\n
elative\\nkivesp\\u00e4i\\nkivi\\u0161p\\u00e4i\\n
illative\\n?\\nkivihe\\n
\\n
adessive\\nkivel\\nkivil\\n
ablative\\nkivelp\\u00e4i\\nkivilp\\u00e4i\\n
allative\\nkivele\\nkivile\\n
\\n
abessive\\nkiveta\\nkivita\\n
comitative\\nkivenke\\nkividenke\\n
prolative\\nkivedme\\nkividme\\n
\\n
approximative I\\nkivenno\\nkividenno\\n
approximative II\\nkivennoks\\nkividennoks\\n
egressive\\nkivennop\\u00e4i\\nkividennop\\u00e4i\\n
\\n
terminative I\\n?\\nkivihesai\\n
terminative II\\nkivelesai\\nkivilesai\\n
terminative III\\nkivessai\\n—\\n
\\n
additive I\\n?\\nkivihep\\u00e4i\\n
additive II\\nkivelep\\u00e4i\\nkivilep\\u00e4i\\n
\\n

Derived terms[edit]

\\n\\n

References[edit]

\\n\\n
\\n

V\\u00f5ro[edit]

\\n

Etymology[edit]

\\n

From Proto-Finnic *kivi, from Proto-Finno-Ugric *kiwe.\\n

\\n

Noun[edit]

\\n

kivi (genitive kivi, partitive kivvi)\\n

\\n
  1. stone, rock
  2. \\n
  3. mill
\\n

Inflection[edit]

\\n

This noun needs an inflection-table template.

\\n\\n\\n\\n\\n
'; diff --git a/src/mock/mock-data.ts b/src/mock/mock-data.ts deleted file mode 100644 index 7b6439f..0000000 --- a/src/mock/mock-data.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { parseWiktionaryData } from "../model/parseWiktionaryData"; -import { - Category, - Expression, - ExpressionSet, - ExpressionToCategory, - ExpressionToExpressionSet, -} from "../model/types"; -import { KiviRaw } from "./kivi"; -import { PuhuaRaw } from "./puhua"; - -interface RawExpressionDataItem { - prompt: string; - data: string; -} -const RawExpressionData: RawExpressionDataItem[] = [ - ["kivi", KiviRaw], - ["puhua", PuhuaRaw], -].map(([prompt, data]) => ({ - prompt, - data, -})); - -interface RawExpressionSetItem { - name: string; - description: string; -} - -const RawExpressionSetData: RawExpressionSetItem[] = [ - ["daily", "New expressions and poorly remembered expressions"], - ["weekly", "Expressions to be reviewed at the end of the week"], - ["monthly", "Expressions to be reviewed at the end of the month"], - ["yearly", "Expressions to be reviewed at the end of the year"], - ["ancient", "Expressions here should be memorized by now"], -].map(([name, description]) => ({ name, description })); - -const RawCategories: string[] = [ - "noun", - "verb", - "adjective", - "adverb", - "determiner", - "article", - "preposition", - "conjunction", - "proper noun", - "letter", - "character", - "phrase", - "proverb", - "idiom", - "symbol", - "syllable", - "numeral", - "initialism", - "interjection", - "definitions", - "pronoun", - "particle", - "predicative", - "participle", - "suffix", -]; - -interface MockData { - // Tables - categories: Category[]; - expressions: Expression[]; - expression_sets: ExpressionSet[]; - - // Relationships - expression_to_category: ExpressionToCategory[]; - expression_to_expression_set: ExpressionToExpressionSet[]; -} - -interface ParseRawDataArgs { - raw_category_data: string[]; - raw_expression_data: RawExpressionDataItem[]; - raw_expression_set_data: RawExpressionSetItem[]; -} - -export function parseRawData({ - raw_category_data, - raw_expression_data, - raw_expression_set_data, -}: ParseRawDataArgs): MockData { - const categories: Category[] = raw_category_data.map((name) => ({ - name, - description: name, - })); - - const expression_sets: ExpressionSet[] = raw_expression_set_data.map( - ({ name, description }) => ({ - name, - description, - }) - ); - - const expressions: Expression[] = []; - const expression_to_category: ExpressionToCategory[] = []; - const expression_to_expression_set: ExpressionToExpressionSet[] = []; - for (const { prompt, data } of raw_expression_data) { - console.log("Parsing", { prompt, data }); - const expression = parseWiktionaryData(prompt, data); - if (!expression) continue; - - expressions.push(expression); - const expression_id = expressions.length; - /* - expression_to_category.push( - matchExpressionAndCategory({ - expression_id, - category_name, - categories, - }) - ); - */ - expression_to_expression_set.push({ - expression_id, - expression_set_id: 1, - }); - } - - return { - categories, - expressions, - expression_sets, - expression_to_category, - expression_to_expression_set, - }; -} - -interface MatchExpressionAndCategoryParams { - expression_id: number; - category_name: string; - categories: Category[]; -} - -function matchExpressionAndCategory({ - expression_id, - category_name, - categories, -}: MatchExpressionAndCategoryParams): ExpressionToCategory { - const category_id = - categories.findIndex(({ name }) => name === category_name) + 1; - return { - category_id, - expression_id, - }; -} - -export const MockData = parseRawData({ - raw_category_data: RawCategories, - raw_expression_data: RawExpressionData, - raw_expression_set_data: RawExpressionSetData, -}); diff --git a/src/mock/puhua.ts b/src/mock/puhua.ts deleted file mode 100644 index 775ca9b..0000000 --- a/src/mock/puhua.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Retrieved on 2022.07.24 from: -// https://en.wiktionary.org/w/api.php?action=parse&format=json&prop=text&page=puhua - -export const PuhuaRaw: string = - '
\\n\\n

Finnish[edit]

\\n

Etymology[edit]

\\n

From Proto-Finnic *puhudak (\\u201cto blow\\u201d), from Proto-Uralic *pu\\u0161e- (\\u201cto blow\\u201d); cognate with Northern Sami bossut and possibly also with Erzya \\u043f\\u0443\\u0432\\u0430\\u043c\\u0441 (puvams, \\u201cto blow\\u201d).\\n

\\n

Pronunciation[edit]

\\n\\n

Verb[edit]

\\n

puhua\\n

\\n
  1. (intransitive) To talk (about = elative).
  2. \\n
  3. (transitive, + partitive) To speak (a language).
\\n

Conjugation[edit]

\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
Inflection of puhua (Kotus type 52/sanoa, no gradation)\\n
indicative mood\\n
present tense\\nperfect\\n
person\\npositive\\nnegative\\nperson\\npositive\\nnegative\\n
1st sing.\\npuhun\\nen puhu\\n1st sing.\\nolen puhunut\\nen ole puhunut\\n
2nd sing.\\npuhut\\net puhu\\n2nd sing.\\nolet puhunut\\net ole puhunut\\n
3rd sing.\\npuhuu\\nei puhu\\n3rd sing.\\non puhunut\\nei ole puhunut\\n
1st plur.\\npuhumme\\nemme puhu\\n1st plur.\\nolemme puhuneet\\nemme ole puhuneet\\n
2nd plur.\\npuhutte\\nette puhu\\n2nd plur.\\nolette puhuneet\\nette ole puhuneet\\n
3rd plur.\\npuhuvat\\neiv\\u00e4t puhu\\n3rd plur.\\novat puhuneet\\neiv\\u00e4t ole puhuneet\\n
passive\\npuhutaan\\nei puhuta\\npassive\\non puhuttu\\nei ole puhuttu\\n
past tense\\npluperfect\\n
person\\npositive\\nnegative\\nperson\\npositive\\nnegative\\n
1st sing.\\npuhuin\\nen puhunut\\n1st sing.\\nolin puhunut\\nen ollut puhunut\\n
2nd sing.\\npuhuit\\net puhunut\\n2nd sing.\\nolit puhunut\\net ollut puhunut\\n
3rd sing.\\npuhui\\nei puhunut\\n3rd sing.\\noli puhunut\\nei ollut puhunut\\n
1st plur.\\npuhuimme\\nemme puhuneet\\n1st plur.\\nolimme puhuneet\\nemme olleet puhuneet\\n
2nd plur.\\npuhuitte\\nette puhuneet\\n2nd plur.\\nolitte puhuneet\\nette olleet puhuneet\\n
3rd plur.\\npuhuivat\\neiv\\u00e4t puhuneet\\n3rd plur.\\nolivat puhuneet\\neiv\\u00e4t olleet puhuneet\\n
passive\\npuhuttiin\\nei puhuttu\\npassive\\noli puhuttu\\nei ollut puhuttu\\n
conditional mood\\n
present\\nperfect\\n
person\\npositive\\nnegative\\nperson\\npositive\\nnegative\\n
1st sing.\\npuhuisin\\nen puhuisi\\n1st sing.\\nolisin puhunut\\nen olisi puhunut\\n
2nd sing.\\npuhuisit\\net puhuisi\\n2nd sing.\\nolisit puhunut\\net olisi puhunut\\n
3rd sing.\\npuhuisi\\nei puhuisi\\n3rd sing.\\nolisi puhunut\\nei olisi puhunut\\n
1st plur.\\npuhuisimme\\nemme puhuisi\\n1st plur.\\nolisimme puhuneet\\nemme olisi puhuneet\\n
2nd plur.\\npuhuisitte\\nette puhuisi\\n2nd plur.\\nolisitte puhuneet\\nette olisi puhuneet\\n
3rd plur.\\npuhuisivat\\neiv\\u00e4t puhuisi\\n3rd plur.\\nolisivat puhuneet\\neiv\\u00e4t olisi puhuneet\\n
passive\\npuhuttaisiin\\nei puhuttaisi\\npassive\\nolisi puhuttu\\nei olisi puhuttu\\n
imperative mood\\n
present\\nperfect\\n
person\\npositive\\nnegative\\nperson\\npositive\\nnegative\\n
1st sing.\\n—\\n—\\n1st sing.\\n—\\n—\\n
2nd sing.\\npuhu\\n\\u00e4l\\u00e4 puhu\\n2nd sing.\\nole puhunut\\n\\u00e4l\\u00e4 ole puhunut\\n
3rd sing.\\npuhukoon\\n\\u00e4lk\\u00f6\\u00f6n puhuko\\n3rd sing.\\nolkoon puhunut\\n\\u00e4lk\\u00f6\\u00f6n olko puhunut\\n
1st plur.\\npuhukaamme\\n\\u00e4lk\\u00e4\\u00e4mme puhuko\\n1st plur.\\nolkaamme puhuneet\\n\\u00e4lk\\u00e4\\u00e4mme olko puhuneet\\n
2nd plur.\\npuhukaa\\n\\u00e4lk\\u00e4\\u00e4 puhuko\\n2nd plur.\\nolkaa puhuneet\\n\\u00e4lk\\u00e4\\u00e4 olko puhuneet\\n
3rd plur.\\npuhukoot\\n\\u00e4lk\\u00f6\\u00f6t puhuko\\n3rd plur.\\nolkoot puhuneet\\n\\u00e4lk\\u00f6\\u00f6t olko puhuneet\\n
passive\\npuhuttakoon\\n\\u00e4lk\\u00f6\\u00f6n puhuttako\\npassive\\nolkoon puhuttu\\n\\u00e4lk\\u00f6\\u00f6n olko puhuttu\\n
potential mood\\n
present\\nperfect\\n
person\\npositive\\nnegative\\nperson\\npositive\\nnegative\\n
1st sing.\\npuhunen\\nen puhune\\n1st sing.\\nlienen puhunut\\nen liene puhunut\\n
2nd sing.\\npuhunet\\net puhune\\n2nd sing.\\nlienet puhunut\\net liene puhunut\\n
3rd sing.\\npuhunee\\nei puhune\\n3rd sing.\\nlienee puhunut\\nei liene puhunut\\n
1st plur.\\npuhunemme\\nemme puhune\\n1st plur.\\nlienemme puhuneet\\nemme liene puhuneet\\n
2nd plur.\\npuhunette\\nette puhune\\n2nd plur.\\nlienette puhuneet\\nette liene puhuneet\\n
3rd plur.\\npuhunevat\\neiv\\u00e4t puhune\\n3rd plur.\\nlienev\\u00e4t puhuneet\\neiv\\u00e4t liene puhuneet\\n
passive\\npuhuttaneen\\nei puhuttane\\npassive\\nlienee puhuttu\\nei liene puhuttu\\n
Nominal forms\\n
infinitives\\nparticiples\\n
\\nactive\\npassive\\n\\nactive\\npassive\\n
1st\\npuhua\\npresent\\npuhuva\\npuhuttava\\n
long 1st2\\npuhuakseen\\npast\\npuhunut\\npuhuttu\\n
2nd\\ninessive1\\npuhuessa\\npuhuttaessa\\nagent1, 3\\npuhuma\\n
instructive\\npuhuen\\n—\\nnegative\\npuhumaton\\n
3rd\\ninessive\\npuhumassa\\n—\\n1) Usually with a possessive suffix.
\\n

2) Used only with a possessive suffix; this is the form for the third-person singular and third-person plural.
\\n3) Does not exist in the case of intransitive verbs. Do not confuse with nouns formed with the -ma suffix or the 3rd infinitives.\\n

\\n
elative\\npuhumasta\\n—\\n
illative\\npuhumaan\\n—\\n
adessive\\npuhumalla\\n—\\n
abessive\\npuhumatta\\n—\\n
instructive\\npuhuman\\npuhuttaman\\n
4th\\nnominative\\npuhuminen\\n
partitive\\npuhumista\\n
5th2\\npuhumaisillaan\\n
\\n

Derived terms[edit]

\\n
\\n
Derived terms
\\n
\\n\\n\\n
\\n

References[edit]

\\n\\n

Anagrams[edit]

\\n\\n\\n\\n\\n\\n
'; diff --git a/src/model/database.ts b/src/model/database.ts index 9b19dc1..6d70ee2 100644 --- a/src/model/database.ts +++ b/src/model/database.ts @@ -1,4 +1,4 @@ -import { MockData } from "../mock/mock-data"; +import { initialData } from "./initial-data"; import Dexie, { Table } from "dexie"; import { Category, @@ -42,7 +42,7 @@ database.on("populate", (transaction) => { categories, expression_to_expression_set, expression_to_category, - } = MockData; + } = initialData; db.expressions.bulkAdd(expressions); db.expression_sets.bulkAdd(expression_sets); db.categories.bulkAdd(categories); diff --git a/src/model/initial-data.ts b/src/model/initial-data.ts new file mode 100644 index 0000000..ecd5146 --- /dev/null +++ b/src/model/initial-data.ts @@ -0,0 +1,86 @@ +import { + Category, + Expression, + ExpressionSet, + ExpressionToCategory, + ExpressionToExpressionSet, +} from "./types"; + +const RawExpressionData: Expression[] = []; + +const RawExpressionSetData: ExpressionSet[] = [ + ["daily", "New expressions and poorly remembered expressions"], + ["weekly", "Expressions to be reviewed at the end of the week"], + ["monthly", "Expressions to be reviewed at the end of the month"], + ["yearly", "Expressions to be reviewed at the end of the year"], + ["ancient", "Expressions here should be memorized by now"], +].map(([name, description]) => ({ name, description })); + +// TODO replace with data source, data type or other category like wiktionary, species, math? +const RawCategories: Category[] = [ + "noun", + "verb", + "adjective", + "adverb", + "determiner", + "article", + "preposition", + "conjunction", + "proper noun", + "letter", + "character", + "phrase", + "proverb", + "idiom", + "symbol", + "syllable", + "numeral", + "initialism", + "interjection", + "definitions", + "pronoun", + "particle", + "predicative", + "participle", + "suffix", +].map((name) => ({ name, description: name })); + +interface InitialData { + // Tables + categories: Category[]; + expressions: Expression[]; + expression_sets: ExpressionSet[]; + + // Relationships + expression_to_category: ExpressionToCategory[]; + expression_to_expression_set: ExpressionToExpressionSet[]; +} + +interface ParseRawDataArgs { + raw_category_data: Category[]; + raw_expression_data: Expression[]; + raw_expression_set_data: ExpressionSet[]; +} + +export function parseRawData({ + raw_category_data, + raw_expression_data, + raw_expression_set_data, +}: ParseRawDataArgs): InitialData { + const expression_to_category: ExpressionToCategory[] = []; + const expression_to_expression_set: ExpressionToExpressionSet[] = []; + + return { + categories: raw_category_data, + expressions: raw_expression_data, + expression_sets: raw_expression_set_data, + expression_to_category, + expression_to_expression_set, + }; +} + +export const initialData = parseRawData({ + raw_category_data: RawCategories, + raw_expression_data: RawExpressionData, + raw_expression_set_data: RawExpressionSetData, +});