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.


Usage

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)
#<PACKAGE WORDS-TYL-SJOK>
WORDS-TYL-SJOK[3]> (random-word *phonotactics*)
"syli"
WORDS-TYL-SJOK[4]> (random-word *phonotactics*)
"utik"
WORDS-TYL-SJOK[5]> (random-word *phonotactics*)
"jy"
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 *))
"jy"

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


Download

words.lsp

The library file

words-tyl-sjok.lsp

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

words-s7.lsp

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

Index

January 14th, 2013
Comments? Suggestions? Corrections? You can drop me a line.
zpentrabvagiktu@theiling.de
Schwerpunktpraxis
Datenschutz