#!C:\local\PERL5\NTT\perl.exe
#print("Need input \n"); #Used in interactive mode
#inline holds a line.
$inline=<STDIN>;
chop($inline);
while ($inline){
#
# word declensions are in two parts separated by =
# First part is the English description, second the devnagari
# formation.
# In the second part, syllables are separated by spaces and need
# joining.

@parts=split(/=/,$inline);
$num = @parts;

#
# num is used to count number of parts. If it is 1, then 
# we have the defining word in roman script.
#print($num);
#
# Always, the desc gets enclosed in ## ##.
#

$desc=@parts[0];
$desc =~ s/</##</;
$desc =~ s/>/>##/;

#
# The devnag part gets transformed for ITRANS.
#

@devnag = split(/ /,@parts[1]);
$devnag= join(/ /,@devnag);
$devnag =~ s/m *$/m.h/;
$devnag =~ s/n *$/n.h/;
$devnag =~ s/r *$/H/;
$devnag =~ s/s *$/H/;
$devnag =~ s/t *$/t.h/;
#
# In case of meaning and gender, the devnag part is in English too!
# Otherwise, devnag part is in devnagari!
#
if ($desc =~ /meaning/) {$devnag = ("##".@parts[1]."##");}
if ($desc =~ /<gen>/) {$devnag = ("##".@parts[1]."##");}
if ($num == 1) {print ("##".$desc."##"."\n");}
else {print($desc,$devnag,"\n");}
#print("Again?\n");
$inline=<STDIN>;
chop($inline);
}
die("## Finished processing ##\n");

