testing for plural inflections set
This commit is contained in:
parent
69be75317b
commit
e6e35cc0ec
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lingdocs/pashto-inflector",
|
"name": "@lingdocs/pashto-inflector",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"author": "lingdocs.com",
|
"author": "lingdocs.com",
|
||||||
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
||||||
"homepage": "https://verbs.lingdocs.com",
|
"homepage": "https://verbs.lingdocs.com",
|
||||||
|
|
|
@ -62,7 +62,7 @@ const InflectionTable = ({ inf, textOptions }: {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{(!isPluralInfs ? ["Plain", "1st", "2nd"] : ["Plural", "2nd"]).map((title, i) => (
|
{(!isPluralInfs ? ["Plain", "1st", "2nd"] : ["Plural", "2nd Inf."]).map((title, i) => (
|
||||||
<tr key={title}>
|
<tr key={title}>
|
||||||
<th scope="row">{title}</th>
|
<th scope="row">{title}</th>
|
||||||
{"masc" in inf && <TableCell item={inf.masc[i]} textOptions={textOptions} />}
|
{"masc" in inf && <TableCell item={inf.masc[i]} textOptions={textOptions} />}
|
||||||
|
|
|
@ -255,10 +255,19 @@ export function isVerbBlock(x: unknown): x is T.VerbBlock {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isPluralInflectionSet(x: any): x is T.PluralInflectionSet {
|
||||||
|
return (
|
||||||
|
Array.isArray(x)
|
||||||
|
&& (x.length === 2)
|
||||||
|
&& "p" in x[0][0]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export function isImperativeBlock(x: unknown): x is T.ImperativeBlock {
|
export function isImperativeBlock(x: unknown): x is T.ImperativeBlock {
|
||||||
return (
|
return (
|
||||||
Array.isArray(x) &&
|
Array.isArray(x) &&
|
||||||
(x.length === 2) &&
|
(x.length === 2) &&
|
||||||
|
!("p" in x[0][0]) &&
|
||||||
"p" in x[0][0][0]
|
"p" in x[0][0][0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue