[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Word generation



Geoff Eddy wrote:

> I remember some time ago Andrew Smith mentioning a Perl script he'd
> written which, given a Latin input, produced the appropriate Brithenig
> word.

Actually I wrote it, but I never released it because I never thought
it was up to snuff.  But it's attached here as a plain-text
attachment, so even the MIME-impaired should be able to read it.


-- 
John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)
$CON = "[BCDFGHKLMNPRSTVXbcdfghklmnprstwx]";
$VOW = "[aeiou]";
$EVOW = "$VOW|";
while (<>) {
	chop;

	# convert Latin to upper case
	tr/[a-z]/[A-Z]/;

	# pre-Romance transformations
	s/S$//og;
	s/M$//og;
	s/Y/U/og;
	$vulgar = $_;

	# use "w" for Latin "v" (representation change, not sound change)
	s/^V/gw/og;
	s/V/w/og;

	# slaughter final vowels
	s/[AEIOU]$//og;

	# complex vowel transformations
	s/ACT/aeth/og;
	s/ECT/eith/og;
	s/ICT/i:th/og;
	s/OCT/oeth/og;
	s/UCT/uith/og;
	s/AX/aes/og;
	s/EX/eis/og;
	s/IX/i:s/og;
	s/UX/uis/og;
	s/AU/o/og;

	# umlaut
	s/ER($CON)/ar$1/og;
	s/I($CON)A$/e$1/og;
	s/I([A-Z])A$/o$1/og;
	s/A($CON)I$/ei$1/og;
	s/A[UW]I/ew/og;
	s/A($CON)/e$1/og;
	s/[EOU]($CON)i$/y$1/og;
	s/[EO]($CON)i/e$1/og;
	s/II/ei/og;

	# Western Romance vowels
	s/A:/a/og;
	s/A/a/og;
	s/E:/ui/og;
	s/E/e/og;
	s/OE/ui/og;
	s/I:/i/og;
	s/I/i/og;
	s/O:/u/og;
	s/O/o/og;
	s/U:/y/og;
	s/U/u/og;

	# p clusters
	s/PT/th/og;
	s/RP/rff/og;
	s/LP/lff/og;
	s/RPT/rth/og;
	s/PP/ff/og;
	s/PH/ff/og;

	# t clusters
	s/TH/th/og;
	s/LT$/llt/og;
	s/LT/ll/og;
	s/RT/rth/og;

	# c clusters
	s/QU/c/og;
	s/CC/ch/og;
	s/CT/ith/og;
	s/NCT/ith/og;
	s/CL/gl/og;
	s/CR/gr/og;
	s/LC/lch/og;
	s/RC/rch/og;

	# b clusters
	s/aB/aw/og;
	s/oB/o:/og;
	s/uB/u:/og;
	s/eB/e/og;
	s/iB/i/og;
	s/eiB/ei/og;
	s/B([LRN])/f\L$1/og;

	# d clusters
	s/DD($CON)/\L$1/og;
	s/\WDR\W/ir/og;
	s/\WDM\W/im/og;
	s/LD/llt/og;
	s/RD/rdd/og;

	# g clusters
	s/G([NLR])/i\L$1/og;
	s/([LR])G/\L$1y/og;

	# l clusters
	s/LL/ll/og;
	s/NL/nll/og;

	# r clusters
	s/NR/nrh/og;

	# n clusters
	s/NF/ff/og;

	# s clusters
	s/^S($CON)/ys\L$1/og;
	s/X/is/og;
	s/SL/ll/og;
	s/^SR/rh/og;
	s/SR/rr/og;
	s/LS/ls/og;
	s/RS/rs/og;
	s/SM/m/og;
	s/SN/n/og;
	s/NS/s/og;
	s/SW/chw/og;

	# individual consonants
	s/($VOW)P($EVOW)/\L$1b\L$2/og;
	s/P/p/og;
	print "$_\n";
	s/($VOW)T($EVOW)/\L$1d\L$2/og;
	s/T/t/og;
	s/($VOW)C($EVOW)/\L$1g\L$2/og;
	s/C/c/og;
	s/B/b/og;
	s/($VOW)D($EVOW)/\L$1dd\L$2/og;
	s/D/d/og;
	s/($VOW)G($EVOW)/\L$1\L$2/og;
	s/G/g/;
	s/^L/ll/og;
	s/L/l/og;
	s/^R/rh/og;
	s/R/r/og;
	s/^F/ff/og;
	s/F/f/og;
	s/N/n/og;
	s/S/s/og;
	s/M/m/og;
	s/H//og;

	print "$vulgar = $_\n";
	}