dictionary type update
This commit is contained in:
parent
afe8bd43ce
commit
40ab04d45c
|
@ -1,5 +1,6 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
|
const { readDictionary } = require("@lingdocs/pashto-inflector");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const verbsPath = path.join(".", "src", "words");
|
const verbsPath = path.join(".", "src", "words");
|
||||||
const verbCollectionPath = path.join(verbsPath, "verb-categories");
|
const verbCollectionPath = path.join(verbsPath, "verb-categories");
|
||||||
|
@ -19,8 +20,9 @@ const allNounAdjTsS = [...new Set(nounAdjTsFiles.reduce((arr, fileName) => {
|
||||||
|
|
||||||
console.log("getting words from dictionary...");
|
console.log("getting words from dictionary...");
|
||||||
|
|
||||||
fetch(process.env.LINGDOCS_DICTIONARY_URL).then(res => res.json()).then(data => {
|
fetch(process.env.LINGDOCS_DICTIONARY_URL).then(res => res.arrayBuffer()).then(buffer => {
|
||||||
const entries = data.entries;
|
const dictionary = readDictionary(buffer);
|
||||||
|
const entries = dictionary.entries;
|
||||||
// MAKE VERBS FILE
|
// MAKE VERBS FILE
|
||||||
const allVerbs = getVerbsFromTsS(entries);
|
const allVerbs = getVerbsFromTsS(entries);
|
||||||
const content = `const verbs = ${JSON.stringify(allVerbs)};
|
const content = `const verbs = ${JSON.stringify(allVerbs)};
|
||||||
|
|
Loading…
Reference in New Issue