From 9192e070e175334afb67aeded94faf82780901b9 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 12 Sep 2021 23:06:42 -0700 Subject: [PATCH] Add Elesu support --- src/App.tsx | 37 +++++++++++++++++++++++++------------ src/dbtypes.ts | 15 ++++++++++++++- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 4ec31ef..77fc5a5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import React, {useState} from 'react'; import './App.scss'; import {declineSaimiar} from './saimiar_morphology'; -import {SaiEntryProps, JutEntryProps} from './dbtypes'; +import {SaiEntryProps, JutEntryProps, ElesuEntryProps} from './dbtypes'; const backendUrl = 'https://kucinakobackend.ichigo.everydayimshuflin.com'; @@ -58,7 +58,7 @@ function buildRequest(searchTerm: string, conlang: Conlang, direction: SearchDir interface EntryProps { conlang: Conlang; - entry: SaiEntryProps | JutEntryProps; + entry: SaiEntryProps | JutEntryProps | ElesuEntryProps; key: string; } @@ -72,6 +72,10 @@ const Entry = (props: EntryProps) => { return ; } + if (conlang === Conlang.Elesu) { + return ; + } + return
Conlang { conlang } not yet supported
; }; @@ -106,6 +110,19 @@ const JutEntry = (props: {entry: JutEntryProps}) => { ); }; +const ElesuEntry = (props: {entry: ElesuEntryProps}) => { + const {entry} = props; + + return ( +
+ { entry.elesu } - { entry.eng } +
+ + { entry.syn_category } + +
); +}; + function formatMorphology(entry) { const decl = declineSaimiar(entry); if (!decl) { @@ -172,15 +189,11 @@ const App = (_props) => { return; } - if (conlang === Conlang.Saimiar || conlang === Conlang.Juteyuji) { - buildRequest(searchTerm, conlang, SearchDirection.ToEnglish, (json) => { - setSearchResults(json); - setSearchTerm(searchTerm); - setDirection(SearchDirection.ToEnglish); - }); - } else { - console.error(`Conlang ${conlang} not supported`); - } + buildRequest(searchTerm, conlang, SearchDirection.ToEnglish, (json) => { + setSearchResults(json); + setSearchTerm(searchTerm); + setDirection(SearchDirection.ToEnglish); + }); }; const searchEng = (_evt) => { @@ -216,7 +229,7 @@ const App = (_props) => {

Kucinako - Wordbook of Arzhanai languages

-

Kucinako is a dictionary for searching for words in various languages of the world Arzhanø, and their English +

Kucinako is a dictionary of words in various languages of the world Arzhanø, and their English equivalents.

{ diff --git a/src/dbtypes.ts b/src/dbtypes.ts index 5063916..f1bf44c 100644 --- a/src/dbtypes.ts +++ b/src/dbtypes.ts @@ -4,6 +4,7 @@ interface SaiEntryProps { eng: string; syn_category: string; morph_type: string; + notes: string; } interface JutEntryProps { @@ -12,6 +13,18 @@ interface JutEntryProps { eng: string; syn_category: string; gender: string; + notes: string; } -export {SaiEntryProps, JutEntryProps}; +interface ElesuEntryProps { + id: number; + elesu: string; + eng: string; + syn_category: string; + gender: string; + sai_borrowing: string; + notes: string; + proto_southern_root: string; +} + +export {SaiEntryProps, JutEntryProps, ElesuEntryProps};