More types
This commit is contained in:
parent
a9703a9529
commit
44156694a2
@ -20,6 +20,7 @@ module.exports = {
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
"arrow-parens": ["error", "always"]
|
"arrow-parens": ["error", "always"],
|
||||||
|
"indent": ["error", 4]
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
"build": "parcel build index.html --no-source-maps",
|
"build": "parcel build index.html --no-source-maps",
|
||||||
"prebuild": "yarn run typecheck",
|
"prebuild": "yarn run typecheck",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"lint": "eslint src/*"
|
"lint": "eslint src/*",
|
||||||
|
"lint-fix": "eslint src/* --fix"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@parcel/transformer-image": "2.0.0-rc.0",
|
"@parcel/transformer-image": "2.0.0-rc.0",
|
||||||
|
@ -1,6 +1,17 @@
|
|||||||
const rootEndingPair = (str) => ({root: str.slice(0, -1), ending: str.slice(-1)});
|
const rootEndingPair = (str) => ({root: str.slice(0, -1), ending: str.slice(-1)});
|
||||||
|
|
||||||
function declineSaimiar(entry) {
|
type SaimiarDeclension = {
|
||||||
|
abs: string;
|
||||||
|
erg: string;
|
||||||
|
adp: string;
|
||||||
|
all: string;
|
||||||
|
loc: string;
|
||||||
|
ell: string;
|
||||||
|
inst: string;
|
||||||
|
rel: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
function declineSaimiar(entry): SaimiarDeclension {
|
||||||
const split = entry.sai.split(' ');
|
const split = entry.sai.split(' ');
|
||||||
const sai = split.at(-1);
|
const sai = split.at(-1);
|
||||||
const morph = entry.morph_type;
|
const morph = entry.morph_type;
|
||||||
@ -26,7 +37,7 @@ function declineSaimiar(entry) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function vowelDeclension(sai: string) {
|
function vowelDeclension(sai: string): SaimiarDeclension {
|
||||||
const {root, ending} = rootEndingPair(sai);
|
const {root, ending} = rootEndingPair(sai);
|
||||||
const adpEnding = ending === 'u' ? 'ys' : `${ending}s`;
|
const adpEnding = ending === 'u' ? 'ys' : `${ending}s`;
|
||||||
|
|
||||||
@ -42,7 +53,7 @@ function vowelDeclension(sai: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function aiDeclension(sai: string) {
|
function aiDeclension(sai: string): SaimiarDeclension {
|
||||||
const {root, ending} = rootEndingPair(sai);
|
const {root, ending} = rootEndingPair(sai);
|
||||||
return {
|
return {
|
||||||
abs: `${root}${ending}`,
|
abs: `${root}${ending}`,
|
||||||
@ -56,7 +67,7 @@ function aiDeclension(sai: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function consonantDeclension(sai: string) {
|
function consonantDeclension(sai: string): SaimiarDeclension {
|
||||||
const split = rootEndingPair(sai);
|
const split = rootEndingPair(sai);
|
||||||
const root = split.ending === 'ø' ? split.root : sai;
|
const root = split.ending === 'ø' ? split.root : sai;
|
||||||
const absFinal = split.ending === 'ø' ? 'ø' : '';
|
const absFinal = split.ending === 'ø' ? 'ø' : '';
|
||||||
@ -75,7 +86,7 @@ function consonantDeclension(sai: string) {
|
|||||||
|
|
||||||
const vowels = ['a', 'e', 'ê', 'i', 'o', 'ô', 'u', 'y'];
|
const vowels = ['a', 'e', 'ê', 'i', 'o', 'ô', 'u', 'y'];
|
||||||
|
|
||||||
function initalDeclension(sai: string) {
|
function initalDeclension(sai: string): SaimiarDeclension {
|
||||||
const initial = sai.slice(0, 1);
|
const initial = sai.slice(0, 1);
|
||||||
const root = sai.slice(1);
|
const root = sai.slice(1);
|
||||||
|
|
||||||
@ -96,4 +107,4 @@ function initalDeclension(sai: string) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export {declineSaimiar};
|
export {declineSaimiar, SaimiarDeclension};
|
||||||
|
Loading…
Reference in New Issue
Block a user