View previous topic :: View next topic |
Author |
Message |
jamapii l33t


Joined: 16 Sep 2004 Posts: 637
|
Posted: Tue May 28, 2019 5:22 pm Post subject: solved: random word or dictionary |
|
|
Hello
How can i create (choose) a random non-english word, or equivalently, an ASCII/UTF list of words of a dictionary.
For example, apg etc. create only passwords, and not actual words.
/usr/share/dict has only English words.
aspell exports and otherwise deals with "word lists", whatever that is, but not dictionaries.
So ...?
Last edited by jamapii on Tue May 28, 2019 5:46 pm; edited 1 time in total |
|
Back to top |
|
 |
e3k Guru


Joined: 01 Oct 2007 Posts: 515 Location: Quantum Flux
|
Posted: Tue May 28, 2019 5:39 pm Post subject: Re: random word or dictionary |
|
|
do you mean absolutely random words? like brute force?
for this you would have to write and iterator that would iterate trough a range of the ASCII table that would write down every possible combination that exists.
that would be used as a dictionary. _________________
Flux & Contemplation - Portrait of an Artist in Isolation
|
|
Back to top |
|
 |
jamapii l33t


Joined: 16 Sep 2004 Posts: 637
|
Posted: Tue May 28, 2019 5:45 pm Post subject: |
|
|
ok just my quick n dirty solution
something like
Code: |
aspell -l de dump master > /tmp/t # replace de with your favourite language
size=$(wc -l /tmp/t)
rnd=$(perl -e 'use Math::Round; print round rand '$size)
head -n $rnd /tmp/t | tail -n 1
|
|
|
Back to top |
|
 |
jamapii l33t


Joined: 16 Sep 2004 Posts: 637
|
Posted: Tue May 28, 2019 5:49 pm Post subject: |
|
|
oh thanks for the reply.
Truly random strings are easy to create with apg, pwgen, ranpwd. These make good passwords.
My select-a-random-word is for words, that should be pronounced and understood, but still be as random as possible. |
|
Back to top |
|
 |
fedeliallalinea Administrator


Joined: 08 Mar 2003 Posts: 31486 Location: here
|
Posted: Tue May 28, 2019 6:07 pm Post subject: |
|
|
I'm not sure if I understand but with app-text/dictd and app-dicts/freedict-*
Code: | $ shuf -n1 /usr/lib64/dict/ita-eng.index | cut -d$'\t' -f1 |
_________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
 |
jamapii l33t


Joined: 16 Sep 2004 Posts: 637
|
Posted: Sun Jun 02, 2019 9:17 am Post subject: |
|
|
thanks a lot, now the script is just
aspell -l de dump master | shuf -n1 |
|
Back to top |
|
 |
|