Core Help Root: Subsystems: Word Generator


This random word generator uses syllables and word patterns, and is inspired by a similar generator written by Ross Smith (Infact, the Lovecraftian dictionary came from his generator).

The generator uses different patterns to generate the word, where each pattern has a chance of being chosen. First is the number of syllables in a word. Once the syllables are chosen a syllable pattern is selected for each syllable. From the syllable pattern vowel or consanant patterns are chosen. It is possible to use two dictionaries for consanants, so as to have 'first' and 'last' consanant patterns. The syllable pattern must be composed of either V (vowel), C (consanant), or LC (last consanant) tokens seperated by dashes, such as:

C-V-LC

Which would imply the syllable pattern of a Consanant-Vowel-Last Consanant.

The various patterns are defined by submitting a configuration to the word generator object (spawn $word for your own generator). This can be done with the simple evaluation command (which will prompt you for the configuration lines):

;$my_word.submit_chances(.read())

You can also list the configuration with:

;.tell($my_word.format_chances())

Configuration

The configuration takes one pattern and chance per line, with an optional comment character of "#" which is discarded. The pattern must begin with a directive designating the pattern. Directives can be any of:

S Number of Syllables
SP Syllable Patterns
C Consanants
LC Last Consanants
V Vowels

There is no limit to the amount of patterns submitted. A very simple configuration would be:

S 2 3
S 3 1

SP V 2
SP V-C 4
SP C-V 2

V a 10
V e 10
V i 10

FC th 1
FC b 4
FC f 4
FC qu 1

LC bh 1
LC d 4
LC b 4


the Cold Dark