From 299d9b5c2377b8e667abdf8ab7a40ce508bdbeb4 Mon Sep 17 00:00:00 2001 From: adueck Date: Wed, 2 Nov 2022 11:05:02 +0500 Subject: [PATCH] cleanup --- get-words.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/get-words.js b/get-words.js index ffb7ed6..3a98075 100644 --- a/get-words.js +++ b/get-words.js @@ -31,10 +31,6 @@ fetch("https://account.lingdocs.com/dictionary/entry", { body: JSON.stringify({ ids: [...allNounAdjTsS, ...allVerbTsS] }), }).then(res => res.json()).then(res => { const verbs = res.results.filter(x => "entry" in x); - const missingEc = []; - verbs.forEach(v => { - if (!v.entry.ec) missingEc.push(v); - }); const verbsContent = ` /** * Copyright (c) 2021 lingdocs.com @@ -68,9 +64,14 @@ const nounsAdjs: DictionaryEntry[] = ${JSON.stringify(nounsAdjs)}; export default nounsAdjs;`; fs.writeFileSync("./src/nouns-adjs.ts", nounsAdjsContent); console.log("fetched words from dictionary"); - if (missingEc.length > 0) { - console.log("Missing ec's in verbs:"); + const missingEc = res.results.filter(x => "entry" in x && !x.entry.ec); + if (missingEc.length) { + console.log("verbs missing ec"); console.log(missingEc); } + if (res.notFound.length) { + console.log("entries not found:"); + console.log(res.notFound); + } });