fix equative explorer

This commit is contained in:
lingdocs 2021-10-09 21:45:42 -04:00
parent 285efdd026
commit 9fc42d9573
2 changed files with 6 additions and 5 deletions

View File

@ -70,8 +70,8 @@ function getNounsAdjsFromTsS(entries) {
console.log("couldn't find ts", item);
return undefined;
}
const firstWord = entry.e.split(",")[0].split(";")[0].split("(")[0].trim();
console.log(firstWord, entry.f, entry.ts);
// const firstWord = entry.e.split(",")[0].split(";")[0].split("(")[0].trim();
// console.log(firstWord, entry.f, entry.ts);
// if (firstWord.contains(" ")) console.log("SPACE PRESENT");
return { entry, def: item.e, category: item.category };
}).filter(x => x);

View File

@ -42,8 +42,9 @@ function makeBlock(e: PredicateInput): T.VerbBlock {
type PredicateType = "adjectives" | "unisexNouns";
function EquativeExplorer() {
// TODO: Use sticky state
const predicateTypes: PredicateType[] = ["adjectives", "unisexNouns"];
const [predicate, setPredicate] = useState<number>(inputs.adjectives[0].ts);
const [predicate, setPredicate] = useState<number>(1527815306);
const [predicateType, setPredicateType] = useState<PredicateType>("adjectives");
function handlePredicateSelect(e: React.ChangeEvent<HTMLSelectElement>) {
setPredicate(parseInt(e.target.value));
@ -97,8 +98,8 @@ function EquativeExplorer() {
value={predicate}
onChange={handlePredicateSelect}
>
{inputs[predicateType].map((adj: AdjectiveInput | UnisexNounInput) => (
<option key={adj.ts} value={adj.ts+"s"}>{adj.p} - {removeFVarients(adj.f)}</option>
{inputs[predicateType].map((e: AdjectiveInput | UnisexNounInput) => (
<option key={e.ts+"s"} value={e.ts}>{e.p} - {removeFVarients(e.f)}</option>
))}
</select>
</div>