wordmap/README.md

34 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2021-02-17 09:04:36 +00:00
# wordmap
2021-02-17 09:39:38 +00:00
### by jan6
2021-02-17 09:04:36 +00:00
2021-02-17 09:38:46 +00:00
maps a string to a word from given word list,
created because I wanted a consistent hash equivalence thingy and only found some overcomplicated ones
```
Usage: wordmap.py <wordlist file> <string to hash> [string to append]
```
where `string to append` is optional, and itself has \x1b[0m appended to it (the "reset formatting" code to stop color bleeding)
2021-02-17 09:38:46 +00:00
2021-02-19 12:22:51 +00:00
for example `python3 wordmap.py wordlists/corncob_lowercase.txt "example words"` would result in `serenades`
and to use the terminal colors: `python3 wordmap.py wordlists/term16color.txt "colored" "colored"`
2021-02-18 06:57:36 +00:00
2021-02-19 12:22:51 +00:00
it can also be imported, something like `python3 -c 'a="examples";from wordmap import wordmap;wordmap("wordlists/term16color.txt",a);print(a+"\x1b[0m")'`
2021-02-17 09:38:46 +00:00
2021-02-17 09:55:59 +00:00
corncob lists included here are from [http://www.mieliestronk.com/wordlist.html](http://www.mieliestronk.com/wordlist.html)
2021-02-18 06:57:36 +00:00
the color names list is from wikipedia, more specifically re-parsed from [https://raw.githubusercontent.com/codebrainz/color-names/master/output/colors.conf](https://raw.githubusercontent.com/codebrainz/color-names/master/output/colors.conf)
2021-02-17 09:55:59 +00:00
but you can use any newline-separated list of strings
2021-02-17 09:38:46 +00:00
some other word lists to save you time:
* [dwyl/english-words](https://github.com/dwyl/english-words/)
* [pos/neg sentiment lexicon](https://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html#lexicon) (needs comment block removal and .rar unpacking)
2021-02-17 09:38:46 +00:00
* [List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words](https://github.com/LDNOOBW/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words)
* [lorenbrichter/Words](https://github.com/lorenbrichter/Words)
* [jlawler's word list from '99](http://www-personal.umich.edu/~jlawler/wordlist.html)
* [scottfrazer's GRE list](https://github.com/scottfrazer/gre/blob/master/words.txt) (needs trivial processing to print first column)
* [linuxwords dictionary by ola](https://users.cs.duke.edu/~ola/ap/linuxwords)
2021-02-17 09:38:46 +00:00
* [Debian's wordlist package](https://packages.debian.org/stable/wordlist)
* [Arch's words package](https://archlinux.org/packages/community/any/words/)
of course, you could also concaternate them all into one massive file, shuffle all the lines, and have one mega-word-list ;P