#!/usr/bin/perl

$class = shift(@ARGV);
$stem = shift(@ARGV);

while ($ARGV[0] ne "") {
    $meaning .= shift(@ARGV) . " ";
}

if ($class eq "fi") {
    @entries = (
		"r	u	noun+fem+i-stem+sg+nom",
		"	u	noun+fem+i-stem+sg+nom",
		"	u	noun+fem+i-stem+sg+acc",
		"ar		noun+fem+i-stem+sg+gen",
		"	u	noun+fem+i-stem+sg+dat",
		"u	u	noun+fem+i-stem+sg+dat",
		"ir		noun+fem+i-stem+pl+nom",
		"ir		noun+fem+i-stem+pl+acc",
		"a		noun+fem+i-stem+pl+gen",
		"um	u	noun+fem+i-stem+pl+dat",

		"in	u	noun+fem+i-stem+sg+nom",
		"ina	u	noun+fem+i-stem+sg+acc",
		"arinnar		noun+fem+i-stem+sg+gen",
		"inni	u	noun+fem+i-stem+sg+dat",
		"irnar		noun+fem+i-stem+pl+nom",
		"irnar		noun+fem+i-stem+pl+acc",
		"anna		noun+fem+i-stem+pl+gen",
		"num	u	noun+fem+i-stem+pl+dat",
		);
}

foreach $entry (@entries) {
    ($ending, $soundchange, $pos) = split (/\t/, $entry);

    $stemcopy = $stem;
    if ($soundchange eq "u") {
	$stemcopy =~ s/au/AU/g;
	$stemcopy =~ s/a/&o-hook;/g;
	$stemcopy =~ s/AU/au/g;
    }

    print $stemcopy, $ending, "\t", $pos, "\t", $meaning, " (*)\n";

}
