#!/usr/bin/perl
#
# This script accepts MLS4UNIX-encoded (7-bit) Mongolian
# where front vowels are substituted by meaningful combinations
# of `e' and `_'; whichever is encountered tells us that
# the word in question should be converted into its 8-bit form.
#
# Unlike unix2mls.pl.Bad this script keeps whitespace where it is.
#
while (<>) {
	s/([A-Za-z_^-]{1,})/unixtomls($1)/eg;
	s/E/e/g;
	print ;
	}
	
sub unixtomls {
		my $wort=$_[0];
		if ($wort =~ /_/ or $wort =~ /e/) 
			{
			$wort=~s/u/ü/g;
			$wort=~s/e/ä/g;
			$wort=~s/o/ö/g;
			$wort=~s/_//;
			}
		$unixtomls=$wort;
	}
