Commit 2b62de6a authored by LiberIT's avatar LiberIT

updated bli2spwih to be goto word finder

parent b8cb5e18
Pipeline #139611339 failed with stages
in 6 minutes and 38 seconds
......@@ -2,10 +2,24 @@
'use strict';
const fs = require('fs');
fs.readFile("dictionary_en.json", "utf8", function(err, contents) {
const input = process.argv[2];
fs.readFile("program/pyashWords.h", "utf8", function(err, contents) {
if (err) return Error(err);
let dictionary = JSON.parse(contents);
//console.log(dictionary);
console.log(dictionary.en.blacklist['X' + process.argv[2]]);
});
let example = new RegExp(input, 'i');
let lines = contents.split('\n');
let produce = lines.filter((line) => {
return example.test(line);
});
if (produce.length == 0) {
fs.readFile("dictionary_en.json", "utf8", function(err, contents) {
if (err) return Error(err);
let dictionary = JSON.parse(contents);
//console.log(dictionary);
console.log(dictionary.en.blacklist['X' + input]);
});
} else {
console.log(produce.join("\n"));
}
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment