Tamil Text Processing with Open-Tamil

Introduction

“”ஓர் ஆயிரம் கழித்தல் ஐந்து பெருக்கல் (ஒன்பது கூட்டல் ஒன்று)” என்பதை எப்படி 950 என்று கணினி புரிந்து கொள்ளும் ? Open-Tamil வழியாகத்தான் – வாங்க இதை பார்க்கலாம்.

Open-Tamil is a free and open-source Tamil Text / Natural Language Processing library (NLP) written in Python, and developed since early 2010s. This blog post is cover our gaps in marketing (on our part, ofcourse) Open-Tamil regarding the capabilities and features presented by Open-Tamil python library. Open-Tamil Python package is distributed under MIT license.

Documentation

Open-Tamil project is currently in the release v0.96 – the Python package can be found here. Documentation from Sphinx for Open-Tamil package can be found on Tamilpesu.us site at this URL.

Installation

Open-Tamil can be installed by running the following command from your terminal with root privileges on Python3. You cannot use current/later versions of Open-Tamil with v2.x – please refer to older releases on pypi page which are still available to you.

$ pip install –upgrade open-tamil>=0.96

If you want to install locally, you can run this command instead,

$ pip install –upgrade open-tamil>=0.96 –user

Python Modules

Open-Tamil provides the following Python modules with various classess and functionalities. You can learn more about them from browsing our documentation.

In summary we can list them as follows,

  Module    Functionality
1

tamil

Tamil tokenization, word ordering, encoding converters, numerals, text summarizer

  Subpackages tamil.txt2ipa package Submodules
tamil.txt2ipa.ipaconvert module
tamil.txt2ipa.transliteration module
tamil.txt2ipa.unicode2ipa module
Module contents
tamil.txt2unicode package Submodules
tamil.txt2unicode.encode2unicode module
tamil.txt2unicode.encode2utf8 module
tamil.txt2unicode.orddic module
tamil.txt2unicode.unicode2encode module
Module contents
tamil.utils package Submodules
tamil.utils.TextSummaryExtractor module
tamil.utils.santhirules module
Module contents
Submodules
tamil.date module
tamil.iscii module
tamil.numeral module
tamil.regexp module
tamil.tscii module
tamil.tscii2utf8 module
tamil.tweetparser module
tamil.utf8 module
tamil.wordutils module
Module contents
2

ngram

corpus modeling classes

  ngram.Corpus module
ngram.Distance module
ngram.LetterModels module
ngram.WordModels module
3

solthiruthi

Tamil spelling checker algorithms

  solthiruthi package
Submodules
solthiruthi.Ezhimai module
solthiruthi.WordSpeller module
solthiruthi.data_parser module
solthiruthi.datastore module
solthiruthi.dictionary module
solthiruthi.dom module
solthiruthi.heuristics module
solthiruthi.morphology module
solthiruthi.resources module
solthiruthi.scoring module
solthiruthi.solthiruthi module
solthiruthi.suggestions module
solthiruthi.vinaisorkal module
Module contents
4

spell

Tamil spelling checker application

  spell package
5

tamilmorse

Morse code utilities for Tamil; இந்த தொகுப்பில் தமிழுக்கான மோர்சு குறிகளை உருவாக்கவும், குறியீடுகளை பிரித்துப்பார்கவும் முடியும்.

  tamilmorse package
Submodules
tamilmorse.morse_encode module
tamilmorse.morse_decode module
6

tamilsandhi

Tamil sandhi rules checker

  tamilsandhi package
தமிழில் சந்திப்பிழை திருத்தி உருவாக்கவும் பிழைக திருத்தவும் உதவியாகஇந்த நிரல் தொகுப்பு வழிவகுக்கும். ஏரக்குறைய 40-விதிகளை கொண்டது இந்த நிரல் தொகுப்பை உருவாக்கியவர் திருமதி. நித்யா. மேலும் விவரங்களுக்க https://github.com/nithyadurai87/tamil-sandhi-checker
7

transliterate

Transliteration tables for Jaffna, University of Madras, Bamini schemes; both forward/backward transliteration algorithms

  transliterate package Submodules
transliterate.UOM module
transliterate.algorithm module
transliterate.azhagi module
transliterate.combinational module
transliterate.jaffna module
Module contents
8

tamilstemmer

This module is new in version 0.96 and provides access to simple stemmer functions originally created by Damodharan Rajalingam.

  Tamil Stemmer source code
9

examples

Various examples and utilities in Open-Tamil package; nifty code tips and tricks

  Open-Tamil source code examples like numeral to audio generation, ngram generation, corpus analysis etc. see link here.

Calculator Example

One fun use of the API is to build interactive websites like tamilpesu.us but a more interesting use is to build a text based calculator taking inputs in form of Tamil numerals with Tamil words for arithmetic operations like add, subtract, multiply and divide.

“”ஓர் ஆயிரம் கழித்தல் ஐந்து பெருக்கல் (ஒன்பது கூட்டல் ஒன்று)” என்பதை எப்படி 950 என்று கணினி புரிந்து கொள்ளும் ?

Using Open-Tamil we can parse the numerals back to numbers and form a simple mathematical infix expression;

1000 – 5 * ( 9 + 1 )

then use Python eval() we can use Python parser and evaluator to build the expression tree and compute the post-order traversal and execute the expression to receive the result, which in our case is not surprisingly,

950.

Well, all this can be done in less than 30 lines of code using Open-Tamil; if you don’t believe me check-out the code here.

Credits

A large number of individuals have contributed their time and effort over the years in many capacities to the project; should you wish to acknowledge this project in your research, products you can choose to cite any of our published works of relevance to you; our publications are listed here.

As always if you wish to report bugs, or share your comments please write an email to me ezhillang AT gmail DOT com or file an issue at github.

 

தமிழ்மகன் – 1

Srinivasa_Ramanujan_-_OPC_-_1

இராமானுஜன் இறந்து நூறாண்டுகள் ஆகிறது. அவரது அதீத, இன்றளவும் உலகம் மீண்டும் காணாத, கணித மேதையான அவரை பலகோணங்களில் காணலாம். அவர் ஒரு தமிழ்மகன் கூட என்றும் வலியுறுத்தி சொல்லவேண்டியது உண்டு. உலகளாவிய பலரும் இராமானுஜனின் கதையில் தமது வேட்கைக்கு ஊக்குவிப்பு தேடுகையில், தமிழராகிய நாமும் அவரது வெற்றிகளில் ஒரு வழி, ஒரு இலட்சிய இலக்கு தெறிகிறது என்றும் எண்ணலாம்; இவரை ஒரு தனிப்பட்ட இனக்குழு, மொழி, நாடு அல்லது துறைசார் நிபுணர் என்று மட்டும் பார்க்காமல் அவரது ஆளுமையில், வெற்றிவேட்கையில், அகால மறைவில் ஒரு மனித சோதனை-வெற்றி-பரிதாபம் என்றெல்லாம் பிரபஞ்சத்தின் உண்மைகளை கண்ட ஒரு தமிழ்மகனாகவும் பார்க்கிறோம்.

Princeton Companion to Mathematics
Princeton Companion to Mathematics

Ramanujan - biography - 1
Ramanujan – biography (Princeton companion to Mathematics)

Ramanujan - biography - 2
Princeton Companion to Mathematics