Tom McDonald said:
Does anyone know of a program that would generate random three-word
nonsense phrases from user-supplied lists of advectives and nouns?
Here you go - requires ruby [
http://rubyinstaller.sourceforge.net/]. You
need to call it from the command line - assuming you've saved it as
nonsense.rb, call it via
c:\> ruby nonsense.rb 5
and it'll spit out 5 nonsense phrases. If you don't supply a number, it
spits out a single phrase. It depends on your wordlists being in the
same directory, and called list1.txt, list2.txt and list3.txt.
It's a very unpolished command line app, but it should do if no one
finds anything nicer.
martin
-------------------------------------------------------------------
class Array
def rand
at(Kernel.rand(size))
end
end
lists = ['list1.txt', 'list2.txt', 'list3.txt'].map {|f|
IO.readlines(f).map! {|i| i.chomp}
}
n = (ARGV[0] || 1).to_i
n.times { puts lists.map {|i| i.rand}.join(' ') }