How Could I Randomize A Dictionary?

Page 4 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Gizmo j

Golden Member
Nov 9, 2013
1,638
436
136
(I wanted to ask this again because I never got an answer)


How about, instead of attaching a new number to each word and definitions like this:

1
2
3

I attach the words and definitions with only a "1" like this:

1
1
1

Could I randomize the words by just attaching the number 1 in front of it? Or does it have to be more then a single letter?
 

IronWing

No Lifer
Jul 20, 2001
72,853
33,912
136
(I wanted to ask this again because I never got an answer)


How about, instead of attaching a new number to each word and definitions like this:

1
2
3

I attach the words and definitions with only a "1" like this:

1
1
1

Could I randomize the words by just attaching the number 1 in front of it? Or does it have to be more then a single letter?
I'm not really following that. You could randomize the words and definition by creating a hash with the words as keys and the definitions as the values. No need for assigning any numbers at all.

You might consider learning perl as it is ideal for text manipulation.
 

Gizmo j

Golden Member
Nov 9, 2013
1,638
436
136
I'm not really following that. You could randomize the words and definition by creating a hash with the words as keys and the definitions as the values. No need for assigning any numbers at all.

You might consider learning perl as it is ideal for text manipulation.

Sorry I don't really know how to program.

I was thinking I needed to attach the words and definitions to a number, then randomize the number to randomize the dictionary.
 

Red Squirrel

No Lifer
May 24, 2003
70,568
13,803
126
www.anyf.ca
If you really don't want to learn how to do it with programming you can probably do it in Excel. Have the entire list in Excel then use the rand function. You can format it the way you want from there.
 
  • Like
Reactions: igor_kavinski

Gizmo j

Golden Member
Nov 9, 2013
1,638
436
136
If you really don't want to learn how to do it with programming you can probably do it in Excel. Have the entire list in Excel then use the rand function. You can format it the way you want from there.

That's what I was thinking of doing.

I was thinking I could pay someone to type out all the words and definitions and attach them to a number.

Maybe $50 per letter.
 
  • Haha
Reactions: dank69

Red Squirrel

No Lifer
May 24, 2003
70,568
13,803
126
www.anyf.ca
I'm sure you can just find a list somewhere that's in CSV and import it. Look back at this thread and look at the list I used, it might be something you can just import in Excel.
 
Jul 27, 2020
28,175
19,197
146
Gizmo Dictionary <<< seriously get a patent on that.

When you want to learn the meaning of a word but have to go through thousands of random words before you find what you are looking for!
 

Gizmo j

Golden Member
Nov 9, 2013
1,638
436
136
I just think it's fun to read random words and definitions....

Sort of like a 'Word Of The Day' calendar but on steroids.
 

sao123

Lifer
May 27, 2002
12,653
205
106
why on earth would you try to put the complete volume of words into memory at one time?
Just select a file at random, then select a word/definition at random from inside the file?


A much more efficient way to accomplish this would be a SQL database and about a dozen lines of SQL code and a dozen lines of code in C#.

Declare @RecordCount Int
Declare @randomnumber Int
Set @RecordCount = Select Count(*) from Dictionary
Set @randomnumber = RAND(RecordCount)

Select ID, Word, Definition from Dicitonary where ID=@RandomNumber

Then you could use an ADO.net call for SQLDataReader in C# to run the SQL procedure.


unless the intention is to find the most obscure impractical way of doing this? I'm sure x86 assembly would present a solution...
 

Red Squirrel

No Lifer
May 24, 2003
70,568
13,803
126
www.anyf.ca
I just think it's fun to read random words and definitions....

Sort of like a 'Word Of The Day' calendar but on steroids.

We've provided tons of info, and even code. It would really not be hard to figure out the rest from here or even get ChatGPT to do a big chunk of the work for you.
 
  • Like
Reactions: lxskllr

WilliamM2

Platinum Member
Jun 14, 2012
2,969
875
136
I just think it's fun to read random words and definitions....

Sort of like a 'Word Of The Day' calendar but on steroids.
Then open a random page and point your finger with your eyes closed. Pretty simple.

A random dictionary is stupid. There is just no nice way to put it.
 

sdifox

No Lifer
Sep 30, 2005
100,245
17,895
126
I just think it's fun to read random words and definitions....

Sort of like a 'Word Of The Day' calendar but on steroids.
Buy a dictionary.
Shred it.
Pick one piece up from the pile, there is your random word(s)

Actually buy two, you'll need an intact one to look up the word and the meaning.
 
Last edited:

dank69

Lifer
Oct 6, 2009
37,356
32,985
136
I just think it's fun to read random words and definitions....

Sort of like a 'Word Of The Day' calendar but on steroids.
If you think hard enough about it all letters and words are random so going alphabetically can pass as random. Today's word is a.
 

Gizmo j

Golden Member
Nov 9, 2013
1,638
436
136
If you think hard enough about it all letters and words are random so going alphabetically can pass as random. Today's word is a.

But then why aren't 'Word Of The Day' calendars in alphabetical order?
 

sdifox

No Lifer
Sep 30, 2005
100,245
17,895
126
I still say, just use "sort" built into linux or bsd. You can even do it in windows if you use the WSL. I assume apples can do it as OSX is based on BSD.


-R, --random-sort
shuffle, but group identical keys. See shuf(1)
No need to sort at all. Just generate random number and show that record/ row

Op just likes to talk about doing shit, not actually doing it.
 
  • Haha
Reactions: yottabit

stargazr

Diamond Member
Jun 13, 2010
4,173
3,706
136
(I wanted to ask this again because I never got an answer)


How about, instead of attaching a new number to each word and definitions like this:

1
2
3

I attach the words and definitions with only a "1" like this:

1
1
1

Could I randomize the words by just attaching the number 1 in front of it? Or does it have to be more then a single letter?
Why can't you just pick up a dictionary and open a random page?
 
  • Like
Reactions: WelshBloke