Created
October 7, 2012 13:12
-
-
Save orymate/3848356 to your computer and use it in GitHub Desktop.
Magyar XKCD jelszó-generátor http://xkcd.com/936/
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
#!/bin/bash | |
DB=/var/tmp/frequent-words | |
CORPUS='ftp://ftp.mokk.bme.hu/Language/Hungarian/Freq/Web2.2/web2.2-freq-sorted.top100k.nofreqs.txt' | |
if [ ! -e "$DB" ] | |
then | |
wget "$CORPUS" -O - | | |
iconv -f latin2 | hunspell -G | hunspell -s | | |
iconv -t ascii//TRANSLIT | tr -d ":'\"" | | |
awk '$2 ~ /^[:lower:]/{print $2}' | sort -u > /var/tmp/frequent-words | |
fi | |
for i in $(seq ${2:-1}) | |
do | |
echo $(sort -R "$DB" | head -n ${1:-4}) | |
done |
tgulacsi
commented
Oct 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment