Compiling

Browsing Varamozhi source code

Please visit Sourceforge.net Varamozhi CVS tree browser.

Custom compiling Varamozhi for Windows

Say you are using Kerala font & unicode; and you need to modify the transliteration rules of varamozhi. Follow these steps:

    1. Install Cygwin. You should include packages - gcc, binutils, make, bison, flex and perl

    2. Download and explode Varamozhi source in C:\Temp

    3. Edit varamozhi/map/schm_schm/mozhi.map to your needs

    4. Start->Cygwin->Cygwin Bash shell and do following commands in it

    5. cd /cygdrive/c/Temp/varamozhi

    6. make FONT=kerala

    7. cd test

    8. cp malvi_mozhi_kerala.exe /cygdrive/c/Program\ Files/Varamozhi\ Editor/bin/

    9. Do last 3 steps replacing 'kerala' with 'unicode'.

Compiling Varamozhi on Mac

If one downloads the source and compiles it, the command line tools of varamozhi work on OS X 10.3. To compile one needs to have the Xcode package installed. Xcode can be downloaded for free from the apple developer site (http://www.apple.com/developer/), butyou'll need to register (for free). More importantly, you should have the bandwidth to download the entire package (a few 100 MBs if I recall correctly).

I might still have the binaries that I made lying around. I can send them to you if you are interested.

Btw, another issue with Malayalam on Mac is that there's no unicode font available. Though one can use Anjali, it doesn't render properly because the advanced features in the font (for proper rendering) need to be encoded differently in a mac font.

Finally, if you want a keyboard (instead of using varamozhi) to generate unicode directly, you can try http://www.cs.princeton.edu/~mp/malayalam/keyboard But it's a little buggy, I believe.

cheers,

Manoj ( mp അറ്റ് princeton.edu )

Building and using varamozhi API in C

    • Compile Varamozhi

    • say you are compiling for kerala font, pick the files:

      • mal.tab.c lex.mozhi_kerala.c lex.macro_mozhi_kerala.c mozhi_kerala_default.c

      • common/*.c

      • mal-type.h mal-decl.h

      • windows/*.c

    • compile them together to form the DLL in windows or .a file in unix. if it complains some functions are not found, search for them in the .c/.h files under varamozhi source directory. otherwise ask me; I can help.

    • Sometimes VC++ complains that fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limitlex.mozhi_kerala.c. This error is caused by Microsoft VC++ reaching its internal heap limit. To increase the heap limit:

        1. Go to Project > Settings...

        2. Choose the Linker tab

        3. Go to "Command line for building ... DLL"

        4. Insert /ZM400 just after the cl, (Note 400 indicates 400% more memory than the default allocated by MSVC) Then the command line box should read cl /ZM400 /LD... at the start

    • now use the the interface as shown in this file.

    • FONTAPI local macro is the function of interest. As an example: you would include mal_api.h and call the parser function as:

      • char *malayalm_text =

      • mozhi_kerala_parse(manglish_text, FL_DEFAULT);

Advanced rule syntax in mozhi.map

വാക്കുകള് അവസാനം എങ്ങിനെയാണ് വരമൊഴിയില് കയറുന്നത് എന്നത് ഈ ലിങ്കില് കാണാം: http://varamozhi.cvs.sourceforge.net/varamozhi/varamozhi/varamozhi/map/schm_schm/mozhi.map?view=markup

അതില് $ ചിഹ്നം വച്ച് അവസാനിപ്പിച്ചിരിക്കുന്ന വാക്കുകള്ക്കാണ് കരീം പറഞ്ഞ പ്രശ്നമുള്ളത്. $ ചിഹ്നത്തിന്റെ അര്ഥം, ആ വാക്ക് മറ്റക്ഷരങ്ങളോട് കൂടെയല്ലാതെ വരുമ്പോള് മാത്രമേ ആ പറഞ്ഞിരിക്കുന്ന കണ്വെര്ഷന് നടത്താവൂ എന്നാണ്. ഇത് ആദ്യകാലത്ത് ഞാന് ചെയ്തു വന്നിരുന്ന രീതിയാണ്. അടുത്തയിടെയായി, ഞാനൊരിക്കലും $ ചിഹ്നത്തില് അവസാനിക്കുന്ന കണ്വെര്ഷന് റൂളുകള് എഴുതാറില്ല. അതായത് പുതുതായി ചേര്ക്കുന്നവാക്കുകള്ക്കൊക്കെത്തന്നെ പ്രത്യയങ്ങള് (-ഇല്, -കള്, -ന്റെ) ചേര്ക്കാനാവും.

ഈ ഫയല് മനസ്സിലാവാനായി കുറച്ചുകൂടി കാര്യങ്ങള് പറയാം: ^ എന്ന ചിഹ്നത്തിന്റെ അര്ഥം വാക്ക് അടുത്തുവരുന്ന അക്ഷരത്തില് തുടങ്ങണം എന്നാണ്. ഉദാഹരണത്തിന്, ^not = nOTT എന്നൊരു റൂളുണ്ടെങ്കില് അത് ഒരിക്കലും knot എന്നവാക്കില് ഉപയോഗിക്കില്ല.

[Aa] എന്നതിന്റെ അര്ഥം, കാപ്പിറ്റലോ സ്മോളോ അക്ഷരങ്ങള് അവിടെ വരാം എന്നാണ്. ഉദാഹരണത്തിന്, [Cc]ongress = kONgrass എന്നൊരു നിയമമുണ്ടെങ്കില് congress എന്നോ Congress എന്നോ എഴുതിയാലും കണ്വെര്ട്ട് ചെയ്യും.

/ എന്ന ചിഹ്നത്തിന്റെ അര്ഥം: അതുകഴിഞ്ഞുവരുന്ന അക്ഷരങ്ങളും കൂടിയുണ്ടെങ്കിലേ കണ്വെര്ഷന് നടക്കൂ. എന്നാല് / കഴിഞ്ഞുള്ളവയെ കണ്വെര്ട്ട് ചെയ്യില്ല. ഉദാ: umbre/lla = ampra. '/' കഴിഞ്ഞു വരുന്നതില് മറ്റു റൂളുകള് ഉപയോഗിക്കാന് ഇതു സഹായിക്കും.