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: 31414 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 |
|
|
karimali n00b
Joined: 14 Jan 2025 Posts: 2
|
Posted: Tue Jan 14, 2025 11:20 am Post subject: |
|
|
To get a random non-English word or an ASCII/UTF word list, you can try these methods:
Use a non-English word list: Install non-English dictionaries (e.g., apt-get install dictionary-<language> for Debian-based systems) and access them through /usr/share/dict/.
Use wordlist utilities: Tools like random-word or words from wordlist packages can provide random words from various languages.
Create custom lists: Download or generate a custom word list from websites like Wiktionary or GitHub repositories containing multilingual word databases.
These methods will help you get a list of random non-English words. Let me know if you need further assistance!
also visit https://wordslibrary.com/ for more words
Last edited by karimali on Wed Jan 15, 2025 6:05 am; edited 4 times in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22998
|
Posted: Tue Jan 14, 2025 3:10 pm Post subject: |
|
|
karimali: this post was marked as solved in 2019. Additionally, none of your advice appears Gentoo-specific, and some of it is explicitly specific to non-Gentoo Linux systems. Putting all that together, I think you may be in the wrong place, or your post is a precursor to spam content. Please try to stay on topic, and focus on threads that still need a solution. |
|
Back to top |
|
|
|