Auto-declension improvements

This commit is contained in:
Greg Shuflin 2021-09-11 20:14:59 -07:00
parent a1a6370eee
commit 01b11fde0b
2 changed files with 37 additions and 9 deletions

12
App.jsx
View File

@ -64,7 +64,15 @@ function formatMorphology(entry) {
if (!decl) {
return '';
}
return `Abs: ${decl.abs}, Erg: ${decl.erg}, Adp: ${decl.adp}`;
return (<span style={ {fontSize: 'medium', color: '#6a3131'} } >
Abs: <i>{decl.abs}</i>, Erg: <i>{decl.erg}</i>,
Adp: <i>{decl.adp}</i>,
All: <i>{decl.all}</i>,
Loc: <i>{decl.loc}</i>,
Ell: <i>{decl.ell}</i>,
Inst: <i>{decl.inst}</i>,
Rel: <i>{decl.rel}</i>
</span>);
}
class Results extends Component {
@ -92,7 +100,7 @@ class Results extends Component {
const results = this.props.searchResults;
return(
<div className='results'>
{ results ? this.content() : "No search" }
{ results ? this.content() : "No search" }
</div>
);
}

View File

@ -24,10 +24,17 @@ function declineSaimiar(entry) {
function vowelDeclension(sai) {
const { root, ending } = rootEndingPair(sai);
const adpEnding = ending == "u" ? "ys" : `${ending}s`;
return {
"abs": `${root}${ending}`,
"erg": `${root}${ending}na`,
"adp": `${root}${ending}s`,
"adp": `${root}${adpEnding}`,
"all": `so${root}${adpEnding}`,
"loc": `${root}${ending}xa`,
"ell": `tlê${root}${adpEnding}`,
"inst": `${root}${ending}ŕa`,
"rel": `${root}${ending}źi`
};
}
@ -35,17 +42,30 @@ function aiDeclension(sai) {
const { root, ending } = rootEndingPair(sai);
return {
"abs": `${root}${ending}`,
"erg": `${root}${ending}na`,
"adp": `${root}${ending}s`,
"erg": `${root}iad`,
"adp": `${root}i`,
"all": `so${root}i`,
"loc": `${root}iath`,
"ell": `tlê${root}i`,
"inst": `${root}iar`,
"rel": `${root}iai`
};
}
function consonantDeclension(sai) {
const { root, ending } = rootEndingPair(sai);
const split = rootEndingPair(sai);
const root = split.ending == 'ø' ? split.root : sai;
const absFinal = split.ending == 'ø' ? 'ø' : '';
return {
"abs": `${root}${ending}`,
"erg": `${root}${ending}na`,
"adp": `${root}${ending}s`,
"abs": `${root}${absFinal}`,
"erg": `${root}ad`,
"adp": `${root}e`,
"all": `so${root}i`,
"loc": `${root}ak`,
"ell": `tlê${root}i`,
"inst": `${root}ar`,
"rel": `${root}ai`
};
}