This commit is contained in:
lingdocs 2022-03-02 22:56:20 +04:00
parent fa01305393
commit bdbee0e4f7
3 changed files with 25 additions and 17 deletions

View File

@ -21,9 +21,9 @@ const labels = {
[{ masc: "He/It", fem: "She/It"}, "They"], [{ masc: "He/It", fem: "She/It"}, "They"],
], ],
eObject: [ eObject: [
["I", "Us"], ["I", "us"],
["You", "You pl."], ["you", "you (pl.)"],
[{ masc: "Him/It", fem: "Her/It"}, "Them"], [{ masc: "him/it", fem: "her/it"}, "them"],
], ],
p: { p: {
far: [ far: [

View File

@ -84,7 +84,7 @@ import * as games from "!babel-loader!@lingdocs/mdx-loader!./games.mdx";
// @ts-ignore // @ts-ignore
import * as pronounPicker from "!babel-loader!@lingdocs/mdx-loader!./practice-tools/pronoun-picker.mdx"; import * as pronounPicker from "!babel-loader!@lingdocs/mdx-loader!./practice-tools/pronoun-picker.mdx";
// @ts-ignore // @ts-ignore
import * as phraseBuilder from "!babel-loader!@lingdocs/mdx-loader!./practice-tools/phrase-builder.mdx"; // import * as phraseBuilder from "!babel-loader!@lingdocs/mdx-loader!./practice-tools/phrase-builder.mdx";
const contentTree = [ const contentTree = [
{ {
@ -271,10 +271,10 @@ const contentTree = [
import: pronounPicker, import: pronounPicker,
slug: "pronoun-picker", slug: "pronoun-picker",
}, },
{ // {
import: phraseBuilder, // import: phraseBuilder,
slug: "phrase-builder", // slug: "phrase-builder",
}, // },
], ],
}, },
]; ];

View File

@ -24,15 +24,23 @@ export function randomPerson(p?: T.Person) {
} }
function isInvalidSubjObjCombo(subj: T.Person, obj: T.Person): boolean { function isInvalidSubjObjCombo(subj: T.Person, obj: T.Person): boolean {
// subject is first person const firstPeople = [
if ([0, 1, 6, 7].includes(subj)) { T.Person.FirstSingMale,
return [0, 1, 6, 7].includes(obj); T.Person.FirstSingFemale,
} T.Person.FirstPlurMale,
// subject is second person T.Person.FirstPlurFemale,
if ([2, 3, 8, 9].includes(subj)) { ];
return [2, 3, 8, 9].includes(obj); const secondPeople = [
} T.Person.SecondSingMale,
return false; T.Person.SecondSingFemale,
T.Person.SecondPlurMale,
T.Person.SecondPlurFemale,
];
return (
(firstPeople.includes(subj) && firstPeople.includes(obj))
||
(secondPeople.includes(subj) && secondPeople.includes(obj))
);
} }
export function randomSubjObj(old?: { subj: T.Person, obj: T.Person }): { subj: T.Person, obj: T.Person } { export function randomSubjObj(old?: { subj: T.Person, obj: T.Person }): { subj: T.Person, obj: T.Person } {