Python

GUI Programming with
      Python and Qt


Quick Links

Home
Python index
GUI Programming with Python Using the Qt Toolkit
Database Objects
Kura (now maintained by Peter Bouda)
CGI scripting and MySQL
Kpybrowser
Python + KDE Tutorial
Python + KDE Resources
PyKDE example programs
Python and Qt2
PyKDE and PyQt news
A population simulation with Stackless Python
Drift: a language simulation in Python
Anonymous CVS access


Changes

  • 28-04-1999 - Creation

© 1999 Boudewijn Rempt
Logo © www.python.org
 

Drift -- a game of language generation

Download: drift-1.0.tar.gz.

CAVEAT DOLATOR: The data files and ipa.py for this app are in utf-8 encoding. Opening and saving them in another encoding DESTROYS the functionality. You have been warned.

ITEM: You need Python 2.2.1 to run drift. Really. I wrote this to experiment with the new features in Python.

Instructions

Set your environment with setenv (after editing it to suit your preferences). Source it:

boud@calcifer:~/prj/drift> . setenv

Run the generator with the packaged phonology and lexicon:

boud@calcifer:~/prj/drift> drift phonology lexicon 

You can redirect the output to a file, if you want to:

boud@calcifer:~/prj/drift> drift phonology lexicon > something.ut8

If you want to create your own phonology, then you should carefully read the example phonology and lexicon files. They tell you everything you need to know.

Hacking

Drift is unmaintained, unloved hackware. You are free to hack around. If you want to send me patches, make sure you have a working unittest for it. Look at unittests.py for example tests. Run the unittests with a simple:

boud@calcifer:~/prj/drift> python unittests.py
testComplexRules (__main__.RuleTestCase) ... ok
testSimpleFinalSubstitution (__main__.RuleTestCase) ... ok
testSimpleInitialSubstitution (__main__.RuleTestCase) ... ok
testSimpleSubstitution (__main__.RuleTestCase) ... ok
testSetPhoneme (__main__.SyllableTestCase) ... ok
testSetPhoneme (__main__.WordTestCase) ... ok

----------------------------------------------------------------------
Ran 6 tests in 14.213s

OK
              

TODO (also known as known bugs):

  • Rules are not applied in order.
  • No provision yet for applying historical sound changes (would be just another file containing the same rules as used during word generation, and another pass in the generation game).
  • No provision for saving a lexicon and continuing at a later stage with it. Everything is regenerated every time.
  • Co-ordinated substitution doesn't work.
  • The rules-engine is brain-dead and dead naive. Have to brush up my algorithms.

DREAMS (also known as you do it):

  • Add multi-threaded dialect generation.
  • Add foreign language influence inserter.

ACKNOWLEDGEMENTS

  • Mark Rosenfelder -- for sounds.c
  • Ken St-Cyr -- for WordSynth
  • Yigal Duppen -- for several regexps I haven't used after all.
  • Jeffrey Henning -- for Langmaker

COPYING

GPL...