DEV Community

Discussion on: Welcome Thread - v11

Collapse
 
dmerand profile image
Donald Merand

:) Well, I use it in the password app to generate "words that sound like English, but usually aren't English". The thinking being that you want a nice long password, easy to remember + type, but hard(er) to crack against a dictionary.

I also have a semi-secret API that I use to generate fake names for humans: robot.lab.explo.org/randomname/3 where you can substitute any number for 3 and get back that number of names :) You can also get JSON from it: robot.lab.explo.org/randomname/3.json. Handy!

And in general, if you have a dictionary (say, of Elvish words), you can make an "Elvish word generator" like this:

require 'markov_words'

generator = MarkovWords::Generator.new(corpus_file: '/path/to/elvish_words.txt')
# returns a random word
puts generator.word