Theiling Online    Sitemap    Conlang Mailing List HQ   

edwerd.pl: vocabulary generation

From:Ed Heil <edheil@...>
Date:Wednesday, August 25, 1999, 3:46
--------------9355527631787247148
Content-Type: text/plain; charset="iso-8859-1"

This is a little perl script that you can use to generate random
words.  The actual word-generation part of it is lifted from Chris
Pound's "werd" script:

http://www.ruf.rice.edu/~pound/

And the format of the rule-files can be found on that page.  (I
include Chris's sample file for generating pseudo-English words.)

The unique thing about this script is that it generates words *one at
a time* and pauses for each to ask the user if he/she likes that word.
 If not, it tries again until it gets a good match for the meaning.
It also allows you to write in a word if you've gotten sick of the
randomly generated ones and want to put one in manually.

It can also be used more than once on a given file of meanings: it
reads in the meanings it generated last time and allows you to keep
them or reject them in favor of randomly or manually generated new
meanings.

The input file consists of lines of the format:

<meaning>

or

<meaning> = <word>

Where <meaning> is a meaning to which you want to assign a word, and
<word> is an existing word you have which is assigned to that meaning.

Perl geeks: keep in mind I'm a beginner at this -- this is my Very
First Perl Program.  There are probably better ways to do a lot of
things I did (I couldn't for the life of me figure out a way to use
regexps to chop whitespace off the right side of a string, for
example, so I used repeated 'chops' to do the trick).  I would welcome
constructive criticism.

Ed

--------------9355527631787247148
Content-Type: application/octet-stream; name="edwerd.pl"
Content-Disposition: attachment; filename="edwerd.pl"
Content-Transfer-Encoding: base64

IyEvdXNyL2xvY2FsL2Jpbi9wZXJsDQojIGVkd2VyZCwgYnkgRWR3YXJkIEhlaWwgKGVkaGVp
bEBwb3N0bWFyay5uZXQpDQojIHRoaXMgaXMgYSBtb2RpZmllZCB2ZXJzaW9uIG9mIENocmlz
IFBvdW5kJ3MgJ3dlcmQnIHByb2dyYW0NCiMgZm91bmQgYXQgaHR0cDovL3d3dy5ydWYucmlj
ZS5lZHUvfnBvdW5kLw0KIyANCiMgSXQgdGFrZXMgYSBydWxlZmlsZSB3aGljaCBkZWZpbmVz
IHRoZSB3YXkgcmFuZG9tIHdvcmRzIGFyZSBnZW5lcmF0ZWQNCiMgKHNlZSB0aGUgZX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XKTsN
CmNsb3NlIChMRVgpOw0KDQpyZW5hbWUoJGxleGZpbGUsIiRsZXhmaWxlLm9sZCIpOw0KcmVu
YW1lKCRuZXdmaWxlLCRsZXhmaWxlKTsNCg0Kc3ViIHBhcnNlIHsNCiAkXz1wb3AoQF8pOw0K
IG15ICgkcmVzdWx0KT0nJzsNCiAvW15BLVpdLyAmJiByZXR1cm4gJF87DQogQFRNUD1zcGxp
dCgvXHMrLywgJHJ1bGV7JF99KTsNCiAkXz1zcGxpY2UoQFRNUCwgcmFuZCBAVE1QLCAxKTsN
CiBmb3IgKHNwbGl0KCcnKSkgeyAkcmVzdWx0ID0gJHJlc3VsdC4mcGFyc2UoJF8pOyB9DQog
cmV0dXJuICRyZXN1bHQNCn0NCg==

--------------9355527631787247148
Content-Type: application/octet-stream; name="w-english"
Content-Disposition: attachment; filename="w-english"
Content-Transfer-Encoding: base64

IyBXZXJkIGRvZXNuJ3QgdGFrZSBraW5kbHkgdG8gaW1wcm9wZXJseSBmb3JtYXR0ZWQgZGF0
YSBmaWxlcy4KIyBGb3IgZXhhbXBsZSwgd2hpdGUgc3BhY2UgaW5zaWRlIGZpZWxkcyAxIGFu
ZCAyIGlzIG1lYW5pbmdmdWwhCiMgQmUgY2FyZWZ1bCB3aXRoIGNvbG9ucyB0b28gLi4uCiMK
IyBOb3RlOiB0aGVyZSBtdXN0IGJlIGEgcnVsZSwgaW5kZXhlZCBhcyAiVyIsIGNvbnRhaW5p
bmcgdGhlCiMgYmFzaWMgY29tYmluYXRpb25zIG9mIHJ1bGVzL2xldHRlcnMgdG8gYmUgZm91
bmQgaW4geW91ciB3b3Jkcy4KIwojIEhlcmUncyB3aGF0IHRoZSBmaWVsZHMgbWVhbjoKIyBS
dWxlLWluZGV4OlJ1bGUgbGlzdAojCiMgSXQncyBhIGdvb2QgaWRlYSB0byBwdXQgY29tbWVu
dHMgdGVsbGluZyB5b3Ugd2hhdCBlYWNoIHJ1bGUKIyBpcyBkZXNpZ25lZCB0byBkb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