From 6002d486ecf1da5f628d826ad8fb0b2fb0b3a964 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 21 Dec 2022 20:09:24 +0000 Subject: [PATCH] Adjust CORPUS Handling --- .gitignore | 2 -- src/utils/corpus.utils.js | 11 ++--------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 8660bb9..ceaea36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -.test-tools - # ---> Node # Logs logs diff --git a/src/utils/corpus.utils.js b/src/utils/corpus.utils.js index 9bbfdfa..8537314 100644 --- a/src/utils/corpus.utils.js +++ b/src/utils/corpus.utils.js @@ -7,8 +7,7 @@ // initAll() : Exported: Uses the internal functions to return a full CORPUS object. // get() : Get the CORPUS data from Network Rail as a gzip file. // extract() : Extract the CORPUS JSON file from the GZIP file. -// clean() : Cleans the CORPUS data, removing unneccesary keys and objects from the data. -// removeBlanks(): Removes keys with the value " ". +// clean() : Cleans the CORPUS data, removing unneccesary non-stations from the data. const axios = require('axios') const gz = require('node-gzip') @@ -25,8 +24,7 @@ async function initSubset() { async function initAll(){ var gzipData = await get() var allCorpus = await extract(gzipData) - var tidied = await removeBlanks(allCorpus) - return tidied + return allCorpus } async function get() { @@ -39,7 +37,6 @@ async function get() { responseType: 'arraybuffer' } var { data } = await axios.get(url, options) - console.log(data) return data } @@ -63,10 +60,6 @@ async function clean(input) { return clean; } -async function removeBlanks(input){ - return input; -} - module.exports = { initAll, initSubset