Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
solved: random word or dictionary
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Tue May 28, 2019 5:22 pm    Post subject: solved: random word or dictionary Reply with quote

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
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 515
Location: Quantum Flux

PostPosted: Tue May 28, 2019 5:39 pm    Post subject: Re: random word or dictionary Reply with quote

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
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Tue May 28, 2019 5:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Tue May 28, 2019 5:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31414
Location: here

PostPosted: Tue May 28, 2019 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
jamapii
l33t
l33t


Joined: 16 Sep 2004
Posts: 637

PostPosted: Sun Jun 02, 2019 9:17 am    Post subject: Reply with quote

thanks a lot, now the script is just


aspell -l de dump master | shuf -n1
Back to top
View user's profile Send private message
karimali
n00b
n00b


Joined: 14 Jan 2025
Posts: 2

PostPosted: Tue Jan 14, 2025 11:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22998

PostPosted: Tue Jan 14, 2025 3:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum