mal
This program converts text in English script to Malayalam script. Malayalam script will be outputted as font keystrokes. Assumes all the kerning or positioning information is encoded in the font itself.
mal [-c] [-h ] [-r] [-o output_file] [input_files...]
-c
If specified the commented portion should be retained along with the characters for commenting. Default action is to remove commented characters and do the required processing to the comment.
This is required when multiple levels of processing is required and the commented text should pass intact through all but last one and comment processing is done only in the last phase. Example could be coupling of scheme to scheme conversion with scheme to font conversion
-h
Generates primitive HTML output. Only the font information is coded in the output. If not specified does plain transliteration. All uncommented characters are considered as Malayalam characters and will be wrapped together in HTML font tags.
-r
In old Malayalam texts, the chillu form of `R' is usually
put as a dot above the succeeding consonant, if exists.
If the flag -r
is set, where ever possible chillu `R' will
be put in dot form. Default action is not to use this dot
for chillu `R'.
-o output_file
Place output in the file output_file
. If this flag is
not specified, output is taken to standard output.
input_files
If specified, input is taken from input_files
parameters,
in the order from left to right. (There can be more than one
input file parameter.) If no input file is specified then
input is received from the standard input.
Defaults values of -c
, -h
and -r
can be changed by configuring the
mapfile.
lam
Converts text in Malayalam script (font keystrokes)
to English script. lam
take input from standard input
and output to standard output.
I will describe this with an example. Suppose you want to covert
a document in Karthika font to Manorama font. Then you need two
mapfiles - for each font, with same transliteration scheme.
Assume we already have karthika.ack and manorama.ack.
Create lam
with setting MAPFILE
variable in Makefile
as karthika.map
. Similarly create mal
with setting MAPFILE
variable as manorama.map
. Now the following command will complete
the conversion:
$ lam < doc_in_karthika | mal > doc_in_manorama
Scheme conversion can adopt a strategy described in Font Conversion section. But there are easier ways for that. It would be interesting to look at the sample scheme conversion mapfiles given in the varamozhi/schemes directory. Suppose we want to convert from scheme A to scheme B. Then we write all the characters defined in the scheme A as SYMBOLS having translation to corresponding ones in scheme B. Then compile as we do for normal scheme to font conversion.
mal
Varamozhi has the facility for generating an API function for English to Malayalam transliteration.
extern int carrycomment;
extern int outputhtml;
extern int allowRdot;
extern char* mal_out_text;
char* mal_parse(const char* mal_in_text);
mal_parse()
takes character string as input parameter.
After conversion the output string is placed in mal_out_text
and starting address is returned by mal_parse()
. While
compiling this function along with third party software,
macro EXECUTABLE
should be undefined. This macro decides
whether to make the executable or function from the code.
Setting the external variables carrycomment, outputhtml
and allowRdot
will set the functionalities specified as
-c
-h
and -r
in the usage of mal
true. On resetting,
the default actions are assumed.