cleanup
This commit is contained in:
parent
09d137a50b
commit
299d9b5c23
13
get-words.js
13
get-words.js
|
@ -31,10 +31,6 @@ fetch("https://account.lingdocs.com/dictionary/entry", {
|
||||||
body: JSON.stringify({ ids: [...allNounAdjTsS, ...allVerbTsS] }),
|
body: JSON.stringify({ ids: [...allNounAdjTsS, ...allVerbTsS] }),
|
||||||
}).then(res => res.json()).then(res => {
|
}).then(res => res.json()).then(res => {
|
||||||
const verbs = res.results.filter(x => "entry" in x);
|
const verbs = res.results.filter(x => "entry" in x);
|
||||||
const missingEc = [];
|
|
||||||
verbs.forEach(v => {
|
|
||||||
if (!v.entry.ec) missingEc.push(v);
|
|
||||||
});
|
|
||||||
const verbsContent = `
|
const verbsContent = `
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2021 lingdocs.com
|
* Copyright (c) 2021 lingdocs.com
|
||||||
|
@ -68,9 +64,14 @@ const nounsAdjs: DictionaryEntry[] = ${JSON.stringify(nounsAdjs)};
|
||||||
export default nounsAdjs;`;
|
export default nounsAdjs;`;
|
||||||
fs.writeFileSync("./src/nouns-adjs.ts", nounsAdjsContent);
|
fs.writeFileSync("./src/nouns-adjs.ts", nounsAdjsContent);
|
||||||
console.log("fetched words from dictionary");
|
console.log("fetched words from dictionary");
|
||||||
if (missingEc.length > 0) {
|
const missingEc = res.results.filter(x => "entry" in x && !x.entry.ec);
|
||||||
console.log("Missing ec's in verbs:");
|
if (missingEc.length) {
|
||||||
|
console.log("verbs missing ec");
|
||||||
console.log(missingEc);
|
console.log(missingEc);
|
||||||
}
|
}
|
||||||
|
if (res.notFound.length) {
|
||||||
|
console.log("entries not found:");
|
||||||
|
console.log(res.notFound);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue