Lisp Project: Random Word Generation

This program lets you define phonotactics and generate words. You can define statistical weights for randomisation. It is used as follows (examples for CLisp and the Tyl-Sjok phonotactics).

The library has more features: if you want to change your phoneme inventory, it lets you decompose a word into a meta-form consisting only of numbers, and then recompose it according to a different phonotactics. You can randomise the decomposition to spread the phonemes. This is useful if you change the number of phonemes.


shell-prompt> clisp -i words-tyl-sjok
;; Loading file words-tyl-sjok.lsp ...
;;  Loading file words.lsp ...
;;  Loading of file words.lsp is finished.
;; Loading of file words-tyl-sjok.lsp is finished.
[1]> (setq *random-state* (make-random-state t))
#S(RANDOM-STATE #*1100...)
[2]> (in-package :words-tyl-sjok)
WORDS-TYL-SJOK[3]> (random-word *phonotactics*)
WORDS-TYL-SJOK[4]> (random-word *phonotactics*)
WORDS-TYL-SJOK[5]> (random-word *phonotactics*)
WORDS-TYL-SJOK[6]> (decompose-word *phonotactics* "jy")
((0 0 532))
WORDS-TYL-SJOK[7]> (decompose-word *phonotactics* "jy" :add-random 1.0)
((27 12 533))
WORDS-TYL-SJOK[8]> (compose-word *phonotactics* (first *))

In the last example, using a different *phonotactics* does the conversion job.



The library file


Phonotactics of Tyl-Sjok (with basic statistical weighting only)


Phonotactics of S7 (roots and stems, with sophisticated statistical weighting)


January 14th, 2013
Comments? Suggestions? Corrections? You can drop me a line.