So I thought, hey let’s try groovysh.
task?
- read wordlist
- convert to lowercase
- remove parts of words
new File("en_US.dic").text.split("\n").each{ new File("result.txt").append "${it.split("/")[0].toLowerCase()}\n" }
ok after a bit more coding I actually wrote a groovy script
- read file
- read file with words we do not want in word list
- convert all values to lowercase
- remove duplicated values
- save to output file
Set<String> cache = new HashSet<String>()
Set<String> result = new HashSet<String>()
new File(“whitelist.txt”).text.split(“\n”).each{ it.split("\t").eachWithIndex{
String s, int index ->
if(index > 0){
cache.add(s.toLowerCase())
}
}
}
new File(“blacklist.txt”).text.split(“\n”).each{
if(cache.contains(it.toLowerCase()) == false){
result.add(it.toLowerCase())
}
}
File out = new File("wordlist.txt")
result.each{
out.append it
out.append "\n"
}
No comments:
Post a Comment