From ec836a84651dc2d3a1935ca066eed666cd19bbf9 Mon Sep 17 00:00:00 2001 From: Thiago Chaves Date: Sun, 17 Jul 2022 22:11:06 +0300 Subject: [PATCH] Richer card rendering using data from Wiktionary The choice for pulling HTML data instead of Wiki markup from Wiktionary was made because the markup content would have required a lot of code to expand the template data into user readable content. --- next.config.js | 9 +- .../ExpressionDescription.tsx | 11 ++ src/components/ExpressionDescription/index.ts | 1 + src/mock/kivi.ts | 6 + src/mock/mock-data.ts | 150 +++++++++++------- src/mock/puhua.ts | 5 + src/model/parseWiktionaryData.ts | 90 +++++++++++ src/model/types.ts | 2 + src/pages/_app.tsx | 1 + src/styles/components.css | 1 + src/styles/wiktionary.css | 36 +++++ .../ExpressionPracticeCardView.tsx | 3 +- 12 files changed, 254 insertions(+), 61 deletions(-) create mode 100644 src/components/ExpressionDescription/ExpressionDescription.tsx create mode 100644 src/components/ExpressionDescription/index.ts create mode 100644 src/mock/kivi.ts create mode 100644 src/mock/puhua.ts create mode 100644 src/model/parseWiktionaryData.ts create mode 100644 src/styles/wiktionary.css diff --git a/next.config.js b/next.config.js index a843cbe..3c0b210 100755 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,11 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, -} + experimental: { + images: { + unoptimized: true, + }, + }, +}; -module.exports = nextConfig +module.exports = nextConfig; diff --git a/src/components/ExpressionDescription/ExpressionDescription.tsx b/src/components/ExpressionDescription/ExpressionDescription.tsx new file mode 100644 index 0000000..c9294e9 --- /dev/null +++ b/src/components/ExpressionDescription/ExpressionDescription.tsx @@ -0,0 +1,11 @@ +import { Expression } from "../../model"; + +export interface ExpressionDescriptionProps { + expression: Expression; +} + +export function ExpressionDescription({ + expression, +}: ExpressionDescriptionProps) { + return
; +} diff --git a/src/components/ExpressionDescription/index.ts b/src/components/ExpressionDescription/index.ts new file mode 100644 index 0000000..669bc97 --- /dev/null +++ b/src/components/ExpressionDescription/index.ts @@ -0,0 +1 @@ +export * from "./ExpressionDescription"; diff --git a/src/mock/kivi.ts b/src/mock/kivi.ts new file mode 100644 index 0000000..61bdd07 --- /dev/null +++ b/src/mock/kivi.ts @@ -0,0 +1,6 @@ +// 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 = + '{"parse": {"title": "kivi", "pageid": 196706, "text": {"*": "
\\n

Contents

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

Czech[edit]

\\n

Etymology[edit]

\\n

From Maori kiwi.\\n

\\n

Pronunciation[edit]

\\n
  • IPA(key): [\\u02c8k\\u026av\\u026a]
\\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
  • kivi in P\\u0159\\u00edru\\u010dn\\u00ed slovn\\u00edk jazyka \\u010desk\\u00e9ho, 1935\\u20131957
  • \\n
  • kivi in Slovn\\u00edk spisovn\\u00e9ho jazyka \\u010desk\\u00e9ho, 1960\\u20131971, 1989
\\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
  • (hashish): Estonian web page that provides information on narcotics [1]
\\n
\\n

Finnish[edit]

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

Etymology[edit]

\\n

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

\\n

Pronunciation[edit]

\\n
  • IPA(key): /\\u02c8ki\\u028bi/, [\\u02c8ki\\u028bi]
  • \\n
  • Rhymes: -i\\u028bi
  • \\n
  • Syllabification: ki\\u2027vi
\\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
  • IPA(key): [\\u02c8kivi]
  • \\n
  • Hyphenation: ki\\u2027vi
  • \\n
  • Rhymes: -vi
\\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
  • V. I. Junus (1936) I\\u01b6oran Keelen Grammatikka[2], Leningrad: Riikin Ucebno-pedagogiceskoi Izdateljstva, page 10
  • \\n
  • Ruben E. Nirvi (1971) Inkeroismurteiden Sanakirja, Helsinki: Suomalais-Ugrilainen Seura, page 172
  • \\n
  • Olga I. Konkova; Nikita A. Dyachkov (2014) Inkeroin Keel: \\u041f\\u043e\\u0441\\u043e\\u0431\\u0438\\u0435 \\u043f\\u043e \\u0418\\u0436\\u043e\\u0440\\u0441\\u043a\\u043e\\u043c\\u0443 \\u042f\\u0437\\u044b\\u043a\\u0443[3], \\u2192ISBN, page 72
\\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
  • IPA(key): [kivi]\\n
    (file)
  • \\n
  • IPA(key): [kivi\\u02d0]\\n
    (file)
\\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:
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
  • kiwi (\\u201ckiwi fruit\\u201d)
\\n

References[edit]

\\n\\n
\\n

Norwegian Nynorsk[edit]

\\n
\\"\\"
Norwegian Nynorsk Wikipedia has an article on:
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
  • kiwi (\\u201ckiwi fruit\\u201d)
\\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
  • Zajceva, N. G.; Mullonen, M. I. (2007), \\u201c\\u043a\\u0430\\u043c\\u0435\\u043d\\u044c\\u201d, in Uz\\u2019 ven\\u00e4-vepsl\\u00e4ine vajehnik / Novyj russko-vepsskij slovar\\u02b9 [New Russian\\u2013Veps Dictionary], Petrozavodsk: Periodika
\\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 index 84f3d6d..7b6439f 100644 --- a/src/mock/mock-data.ts +++ b/src/mock/mock-data.ts @@ -1,3 +1,4 @@ +import { parseWiktionaryData } from "../model/parseWiktionaryData"; import { Category, Expression, @@ -5,31 +6,26 @@ import { ExpressionToCategory, ExpressionToExpressionSet, } from "../model/types"; +import { KiviRaw } from "./kivi"; +import { PuhuaRaw } from "./puhua"; interface RawExpressionDataItem { prompt: string; - description: string; - category: string; - expression_set: string; + data: string; } +const RawExpressionData: RawExpressionDataItem[] = [ + ["kivi", KiviRaw], + ["puhua", PuhuaRaw], +].map(([prompt, data]) => ({ + prompt, + data, +})); interface RawExpressionSetItem { name: string; description: string; } -const RawExpressionData: RawExpressionDataItem[] = [ - ["koira", "noun", "daily", "dog, dog paddle (swimming stroke)"], - ["liite", "noun", "daily", "attachment, appendix, affix, supplement"], - ["havaita", "verb", "daily", "to observe, to detect, to perceive"], - ["tukea", "verb", "daily", "to support, finance, sponsor, substantiate"], -].map(([prompt, category, expression_set, description]) => ({ - prompt, - description, - category, - expression_set, -})); - const RawExpressionSetData: RawExpressionSetItem[] = [ ["daily", "New expressions and poorly remembered expressions"], ["weekly", "Expressions to be reviewed at the end of the week"], @@ -38,6 +34,34 @@ const RawExpressionSetData: RawExpressionSetItem[] = [ ["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[]; @@ -49,25 +73,22 @@ interface MockData { expression_to_expression_set: ExpressionToExpressionSet[]; } -export function parseRawData( - raw_expression_data: RawExpressionDataItem[], - raw_expression_set_data: RawExpressionSetItem[] -): MockData { - const category_names = new Set( - raw_expression_data.map((item) => item.category) - ); - const categories: Category[] = Array.from(category_names).map((name) => ({ +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 expressions: Expression[] = raw_expression_data.map( - ({ prompt, description }) => ({ - prompt, - description, - }) - ); - const expression_sets: ExpressionSet[] = raw_expression_set_data.map( ({ name, description }) => ({ name, @@ -75,48 +96,61 @@ export function parseRawData( }) ); - const expression_to_category: ExpressionToCategory[] = - raw_expression_data.map((item, index) => - matchExpressionAndCategory(index + 1, item, categories) - ); + 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; - const expression_to_expression_set: ExpressionToExpressionSet[] = - raw_expression_data.map((item, index) => - matchExpressionAndExpressionSet(index + 1, item, expression_sets) + 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, - categories, expression_to_category, expression_to_expression_set, }; } -function matchExpressionAndCategory( - expression_id: number, - { category }: RawExpressionDataItem, - categories: Category[] -): ExpressionToCategory { - const category_id = categories.findIndex(({ name }) => name === category) + 1; +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, }; } -function matchExpressionAndExpressionSet( - expression_id: number, - { expression_set }: RawExpressionDataItem, - expression_sets: ExpressionSet[] -): ExpressionToExpressionSet { - const expression_set_id = - expression_sets.findIndex(({ name }) => name === expression_set) + 1; - return { - expression_id, - expression_set_id, - }; -} - -export const MockData = parseRawData(RawExpressionData, RawExpressionSetData); +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 new file mode 100644 index 0000000..2712122 --- /dev/null +++ b/src/mock/puhua.ts @@ -0,0 +1,5 @@ +// 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 = + '{"parse": {"title": "puhua", "pageid": 43830, "text": {"*": "
\\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
  • IPA(key): /\\u02c8puhu\\u0251\\u02e3/, [\\u02c8pu\\u0266u\\u0251(\\u0294)]
  • \\n
  • Rhymes: -uhu\\u0251
  • \\n
  • Syllabification: pu\\u2027hu\\u2027a
\\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/parseWiktionaryData.ts b/src/model/parseWiktionaryData.ts new file mode 100644 index 0000000..9c0716b --- /dev/null +++ b/src/model/parseWiktionaryData.ts @@ -0,0 +1,90 @@ +import { Expression } from "./types"; + +export function parseWiktionaryData( + prompt: string, + data: string +): Expression | null { + // Prevent next.js SSR from crashing here + if (typeof window === "undefined") return null; + + const parser = new DOMParser(); + const description = JSON.parse(data).parse.text["*"]; + const document = parser.parseFromString(description, "text/html"); + + // TODO settings-based language selection + const header = document.getElementById("Finnish")?.parentElement; + if (!header) return null; + + // Grab window of wanted elements and filter out unwanted elements within the window + const elements: (Element | HTMLElement)[] = []; + let current = header.nextElementSibling; + while ( + current && + !["hr", "h2"].includes(current.tagName.toLocaleLowerCase()) && + !isReferences(current) + ) { + let include = true; + include = include && current.tagName.toLocaleLowerCase() !== "style"; + include = include && !current.classList.contains("noprint"); + include = include && !current.classList.contains("inflection-table"); + include = include && !isDeclension(current); + if (include) elements.push(current); + + current = current.nextElementSibling; + } + + const content = document.createElement("div"); + content.className = "wiktionary-content"; + for (const element of elements) { + content.append(safeTreeClone(element) as string | Node); + } + + return { + prompt, + description: content.outerHTML, + }; +} + +function isDeclension(element?: Element | HTMLElement) { + if (!element) return false; + if (element.id.includes("Conjugation")) return true; + if (element.id.includes("Declension")) return true; + let child = element.firstElementChild; + while (child) { + if (isDeclension(child)) return true; + child = child.nextElementSibling; + } +} + +function isReferences(element?: Element | HTMLElement) { + if (!element) return false; + if (element.id.includes("References")) return true; + let child = element.firstElementChild; + while (child) { + if (isReferences(child)) return true; + child = child.nextElementSibling; + } +} + +function safeTreeClone(element?: string | Element | HTMLElement) { + if (!element) return null; + if (typeof element === "string") return document.createTextNode(element); + + if (element.tagName.toLowerCase() === "a") + return document.createTextNode(element.textContent || ""); + if (element.classList.contains("mw-editsection")) return null; + if (element.classList.contains("nyms-toggle")) return null; + if (element.tagName.toLowerCase() === "sup") return null; + + const result = document.createElement(element.tagName); + const children = element.childNodes; + for (let i = 0; i < children.length; i++) { + const child = children.item(i); + if (child.nodeName === "#text") result.append(child.cloneNode()); + else { + const cloned = safeTreeClone(child as Element); + if (cloned) result.append(cloned); + } + } + return result; +} diff --git a/src/model/types.ts b/src/model/types.ts index 5811dfc..7198661 100644 --- a/src/model/types.ts +++ b/src/model/types.ts @@ -1,3 +1,5 @@ +// Internal types + export type Category = { name: string; description: string; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 80976d1..941cfc9 100755 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,5 +1,6 @@ import "../styles/globals.css"; import "../styles/components.css"; +import "../styles/wiktionary.css"; import type { AppProps } from "next/app"; import { Navigation } from "../components"; diff --git a/src/styles/components.css b/src/styles/components.css index 567190f..fe1b67b 100644 --- a/src/styles/components.css +++ b/src/styles/components.css @@ -37,6 +37,7 @@ .text-details { color: darkslategray; font-size: 15px; + line-height: 1.3rem; } /* Page */ diff --git a/src/styles/wiktionary.css b/src/styles/wiktionary.css new file mode 100644 index 0000000..87ad761 --- /dev/null +++ b/src/styles/wiktionary.css @@ -0,0 +1,36 @@ +.wiktionary-content:first-child { + margin-top: 0 !important; +} + +.wiktionary-content h3 { + font-size: 18px; + margin: 14px 0px; +} + +.wiktionary-content h4 { + font-size: 18px; + margin: 14px 0px; +} + +.wiktionary-content p { + margin: 10px 0px; +} + +.wiktionary-content strong { + font-weight: bold; +} + +.wiktionary-content i { + color: darkslateblue; + font-style: italic; +} + +.wiktionary-content ol { + padding-left: 16px; + list-style: decimal; +} + +.wiktionary-content ul { + padding-left: 16px; + list-style: disc; +} diff --git a/src/views/ExpressionPracticeView/ExpressionPracticeCardView.tsx b/src/views/ExpressionPracticeView/ExpressionPracticeCardView.tsx index d97fcef..8fa98dd 100644 --- a/src/views/ExpressionPracticeView/ExpressionPracticeCardView.tsx +++ b/src/views/ExpressionPracticeView/ExpressionPracticeCardView.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; import { ExpressionCard } from "../../components"; +import { ExpressionDescription } from "../../components/ExpressionDescription/ExpressionDescription"; import { IndexedExpression, IndexedCategory } from "../../model"; import { DemoteExpressionButton } from "./DemoteExpressionButton"; import { PromoteExpressionButton } from "./PromoteExpressionButton"; @@ -21,7 +22,7 @@ export function ExpressionPracticeCardView({ category.name)} - description={expression.description} + description={} show_description={revealed} />