Created
January 30, 2021 15:14
-
-
Save mutatrum/3c8f0cb65a7a9b10bd4acaa05358680f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const readline = require('readline'); | |
var english = fs.readFileSync('english.txt', 'utf8').split("\n") | |
const readInterface = readline.createInterface({ | |
input: fs.createReadStream('coinbase.txt'), | |
console: false | |
}); | |
var done = []; | |
readInterface.on('line', function(line) { | |
if (line.length < 5) return; | |
var split = line.toLowerCase().match(/(\b[a-z][a-z][a-z]+|\b[a-z][a-z]\b)/g); | |
if (split) { | |
var e = false; | |
var r = []; | |
for (var p of split) { | |
if (english.includes(p)) { | |
r.push(p); | |
} | |
} | |
if (r.length != 0) { | |
r.sort(); | |
var t = r.join(' '); | |
if (!done.includes(t)) { | |
done.push(t); | |
console.log(line); | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment