How to generate random meaningless, but at the same time easy to remember words?

I need to figure out an algorithm or, even better, if there is an implementation in php / java for generating words that will prompt the user to select as some identifiers, but I want them to be somewhat easy to remember, for example, 'wonifuxa', 'thonqi', 'oqriman' etc., but not something like 'nxdFgtqI'

+6
java string algorithm php
source share
7 answers

Here is a function that generates random words as you describe. He does not use the letter "Q" because this one continued to make unpronounceable words.

<?php //generate random consonants separated by vowels function generate_faux_word($letters = 5){ //define arrays of consonants and vowels //no q, it tough to remember $consonants = array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z'); $vowels = array('a', 'e', 'i', 'o', 'u'); $ret_word = ""; $consonant_toggle = true; //randomly choose a consonant then a vowel until the word is as long as the parameter while(strlen($ret_word) < $letters){ if ($consonant_toggle){ $ret_word .= $consonants[array_rand($consonants)]; $consonant_toggle = false; }else{ $ret_word .= $vowels[array_rand($vowels)]; $consonant_toggle = true; } } return $ret_word; } echo generate_faux_word(); echo "<br />"; echo generate_faux_word(); echo "<br />"; echo generate_faux_word(6); echo "<br />"; echo generate_faux_word(4); ?> 

Sample Output: muher sucok kozive xaso

+6
source share

There is a library for generating spoken words. Here is a link to the library: http://www.multicians.org/thvv/gpw.html . There is a link to the Java source file on this page. First I found a python library for it: http://www.preetk.com/node/pygpw-generate-pronouncable-words/

+5
source share

In the days of telegraphs, when the connection was paid for a letter, quite a few companies developed codes to encode entire sentences as few letters as possible. Most of them had the same basic requirement: a collection of letters that was easy enough to remember. The usual rule was a kind of alternation of groups of vowels and up to two consonants. This would allow (for example) "labdon", but not "aobldn" (same letters, different orders). Almost any sequence you make following a rule like this becomes quite easy to pronounce, so someone can remember it as essentially a word instead of remembering all the individual letters.

+3
source share

Use the dictionary and select two words. Separate them at a random point and connect them.

Example:

 IDEA -> IDE WITHOUT -> THOUT ----------- IDETHOUT 

to get even better results, control the split point (for example, the first word: split on the vowel, the second word: split before the consonant and so that the syllables forming = 3).

+1
source share

Could you create a string one character at a time and have each character a random value between 97-122 (inclusive). These are the ascii decimal values ​​for the letters az (non caps). And then, of course, convert them to a string.

Although, whether this will work, it depends on your definition of "Easy to Remember." Everything is very difficult for them to remember.

0
source share

Incredible word generator. It was built using several different structures, similar to what @Jerry Coffin was talking about. Fun, but not necessarily useful! http://www.mygengen.com/gengens/view/nonsense-words

0
source share

FROM#

  private static string RandomWord(int length) { var consonants = new[] { "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "x", "y", "z" }; var vowels = new[] { "a", "e", "i", "o", "u" }; var word = ""; var b = true; for (var i = 0; i < length; i++) { word += b ? consonants[Rng.Next(consonants.Length)] : vowels[Rng.Next(vowels.Length)]; b = !b; } return word; } 
0
source share

All Articles