Theiling Online    Sitemap    Conlang Mailing List HQ   

Re: Conlang Software

From:Charles <catty@...>
Date:Friday, August 20, 1999, 16:34
Ed Heil wrote:

> I would suggest "Just Plain Perl." I wrote several programs that did > simple sound changes which were less than five lines each. Each > operated on an input file of words and produced an output file of > sound-changed words. > > Learning the subset of Perl which would allow you to do this would > probably be as easy as learning how to use any program that did it for > you.
Exactly. The best part the is "regular expressions", that can do so, to accomplish whatever (orthographic) sound changes desired: while ($it = <>) { # read next line of input $it =~ s/\s+/g # crush multiple spaces/tabs $it =~ s/\s+$//g; # drop leading/trailing space $it =~ s/^\s+//g; $it = lc $it; # change to all lower case $old = $it; # save it ... $it =~ s/c([ie])/s$1/g; # change any C before soft vowels to S $it =~ s/c([aou])/k$1/g; # change C before other vowels into K $it =~ s/^([aeiou])/h$1/g; # add H before vowel-initial words ... add more changes here ... print "$old ---> $it \n"; } There is a Perl available for the slaves of Bill Gates, BTW. Perl is much like BASIC or C++, only more so, yet easier. (Uh, I didn't test the above, but it probably mostly works ...)