From a6f935fc521d8e1a245ae92221b346ac86599321 Mon Sep 17 00:00:00 2001 From: Bill D Date: Tue, 16 Mar 2021 14:07:30 +0400 Subject: [PATCH] update dictionary type --- get-verbs.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/get-verbs.js b/get-verbs.js index d989aff..d6194d1 100644 --- a/get-verbs.js +++ b/get-verbs.js @@ -9,6 +9,7 @@ const fs = require("fs"); const fetch = require("node-fetch"); const path = require("path"); +const { readDictionary } = require("@lingdocs/pashto-inflector"); const collectionPath = path.join(".", "verbs"); const verbTsFiles = fs.readdirSync(collectionPath) @@ -17,8 +18,9 @@ const allTsS = [...new Set(verbTsFiles.reduce((arr, fileName) => { return [...arr, ...TsS]; }, []))]; -fetch(process.env.LINGDOCS_DICTIONARY_URL).then(res => res.json()).then(data => { - const entries = data.entries; +fetch(process.env.LINGDOCS_DICTIONARY_URL).then(res => res.arrayBuffer()).then(buffer => { + const dictionary = readDictionary(buffer); + const entries = dictionary.entries; const allVerbs = getFromTsS(entries); const content = ` /**