சொல்திருத்தி – தெறிந்தவை 7

சென்ற பதிவை எழுதியபின் சிறிது நாடகளில் சொல்வனம் தளத்தில் இருந்து எனக்கு அவர்களின் தரவு கிடைத்தது. இதனை MySQL வடிவில் உருவாக்கி மேலும் அதனை ODBC போன்ற அனுகுமுரைகளின் வகையால் Python நிரல் மூலம் இந்த இதழின் வழி வந்த கட்டுரைகளை மொழியியல் ஆய்விற்கு கொண்டுவரலாம். ஆனால் இதனை செய்ய முதல்படியை கூட இன்னும் தாண்டவில்லை. MySQL மரு நிறுவுதல் சற்று சிக்கலாக உள்ளது.

இந்த பதிவில் விட்டர்பீ அல்கோரிதம் (Viterbi algorithm) என்பதனை கொண்டு எப்படி சொற்பிழைகளை திருத்தலாம் என்பதை மேலோட்டமாக பார்க்கலாம். முழுவிவரங்கள் இங்கே. விட்டர்பீ அல்கோரிதம் என்பது தகவல்தொழில்னுட்பத்தில் பிழைகளை நீக்கும் வண்ணம் வடிவமைக்கப்பட்ட ஒரு மிக முக்கியமான உத்தி/கண்டுபிடிப்பு. இது ஒரு குறியீட்டின் (code), பிழைகளை அந்த குறியீடு எப்படி உருவானது என்ற state-transition-table கொண்டு பிழைகளை நீக்கும்.

இதனை எப்படி மொழியில் சொற்பிழைகளை திருத்த பயன்படுத்துவது ? இதோ இப்படி – இந்த முழு கட்டுரையை பார்த்து தான் நானும் மயங்கினேன். அதாவது மொழியின் 1-கிராம், 2-கிராம், 3-கிராம் ஒலி எண்களின் மாற்றங்கள் புள்ளிவிவரங்களை (ngram state-transition tables) கொண்டு மட்டுமே இதனை சாதிக்க முடியும் என்று Etsy பொறியாளர்கள் சொல்லினார்கள் – அதை நானும் ஒப்புக்கொள்கின்றேன்.

இது சற்று தகவல் தொழில்நுட்பத்தின் சாஷ்டாங்க வழிகளினில் இல்லாவிட்டாலும் மொழியின் கட்டமைப்பை இலக்கணம் வழி இல்லாமல் புள்ளிவிவரத்தின் வாயிலாக எடுத்துக்கொள்ளலாம்.

இந்த பூனைக்கு யார் மணிகட்டுவாங்க ? 🐈

Tamil Entry via Keypad – 9XYZ30-த-மி-ழ்

Previously, My initial calculations can be revised in terms of the estimates. I will not go into further detail here; my latest estimate shows the number of realizable keyboards to be 264,250,749,803,040 or 264billion – a bit of an astronomical number.

The money questions are the following:

  1. Given the astronomical size of keyboards possible is there one that is easily decodable than the other ? Yes, or no ?
  2. Is there any decodable keyboard at all?
  3. Is there a ‘1-800-FLOWERS‘ type of representation possible atleast for a few words in Tamil ?

Today, I was toying with some simple designs and made it into software:

Fig 1: Simple 4×3 keypad layout in iOS

One particular realization of the keyboard looks like where 20 Tamil letters are roughly mapped into 1 keypad as shown in the excel sheet below. We also see the canonical 4×3 keypad matrix in the rows 20-23 showing the 12 keypad positions where 20 letters are going to be mapped into.

Fig 2: Mapping first 20 letters of Tamil alphabet set into a 4×3 keypad.

We show how the phone number “9XYZ30477” will mean “9XYZ30-த-மி-ழ்” in this keypad.

Fig. 3: A simple realization of keypad mapping in Tamil; e.g. number “9XYZ30477” would can be advertised as ‘9XYZ30-த-மி-ழ்’.

Immediately few things are coming to our attention:

  1. Entering user input in the keypad is easy; we follow a simple natural language suggested representation
  2. However, we have some issues in realizing this keyboard – ambiguity: Does ‘111’ in this keypad entry, with following mapping shown, mean ‘அக்கா’ or ‘கட்சி’ ?
  3. The “obvious” finite ring keypad mapping fails here.

Realizations:

  1. Whereas a simple keyboard realization of this scheme shows words typed of equal length like ‘அக்கா’ and ‘கட்சி’ are completely undecidable/un-decodeable. So our criteria is really the good realizable keyboard maximizes the word decidability, or minimizes word collision.
  2. Ease of user input:
    Also we may want to make ease of user entry into this keyboard simpler [which the ‘obvious choice’ keyboard contains] while still maintaining the decodability.
  3. We identify the mapping used above with a simple algebraic structure similar to a finite semi-group with operations of commutativity, in-group operation and identity formed by ‘ஃ’ ayutha letter. This is a interesting mapping with potential to adapt the operator for creating a full semigroup or group structure for the language.
  4. Finally we discover:

The letters with the high bi-gram frequency may not be co-occurring in the same keypad square. This is an operational principle that will reduce the ambiguity of the model. We will have to balance this with other decidability criteria of user input etc.

Operating Principle – we understand this from our failed experiment.

This type of keyboard design could also equally apply for other Abugida languages – which is most Indian languages.

Tamil Entry via Keypad

One problem that seem to not draw interest from various actors in digital Tamil community seems to be the Tamil input via 4 x 3 standard Keypad.

A standard 4×3 keypad shown with digits and letters, including Japanese key entry on a vodafone device. Image credits to Wikipedia.

Problem Statement: Given a 4×3 matrix of keys in a phone keypad, how can we input the basic 13 + 18 + 12×18 = 247 letters of Tamil alphabet using this device ?

Alternate: Clearly, 247 letters have an information content of \log{2}{247} = 7.94836723158 bits or roughly 8bits. So we can simply punch in 3 keys for indicating this 8bit combination and we are done. Provide a table to the user about 247 letters and their 3-numeric key map and we have solved this problem in one way.

This is not very satisfying however; we seem to put the user to more work; we would instead like to have similar entry method in Tamil just like in English (where 3 letters are grouped per telephone key). The processor for application in the phone or mainframe can decode any ambiguity of the telephone keypad mapping into meaningful words or phrases.

Ideas: We can come up with various proposals; being lazy, and the official jester of Tamil computing community, I will try and make a simple combinatorial analysis for this problem without giving a specific solution.

Details: We can consider the factors of 247 = 19 x 13 which form a matrix of all letters representing the Tamil alphabets and we can count the partitions of this matrix onto the smaller keypad matrix. Following the roman letters of English alphabet consisting of 26 letters are fit easily into the 4 x 3 matrix on average of little less than 3 letters per key, we can also adopt a similar convention.

There are many ways to fit this large 19 x 13 matrix into a 4 x 3 matrix. Using simple combinatorial analysis we may show 19 letters can be divided into 4 groups as {19 \choose 4} (ignoring the assignment of letter groups to keys – 4! ways) along the rows. Similarly, we group along columns in {13 \choose 3} ways (and ignoring the 3! column permutation themselves). In all we have a total of {19 \choose 4}\times{13 \choose 3} = 1801371 key grouping combinations.

Clearly we have an alternate possibility of grouping the 19 x 13 matrix as a transposed matrix – i.e grouping dimension of 13 elements of Tamil alphabets into larger keypad dimension of 4, and assigning 19 elements along the fewer keypad dimension of 3. This alternative gives us {13 \choose 4}\times{19 \choose 3} = 692835

Together we have a total of 1,801,371. Thats roughly 1.8 million possibilities! Check them yourself by running this code:

# Code for blog post: https://ezhillang.blog/2019/03/01/tamil-entry-via-keypad/
# This code is in Public Domain.
from math import factorial as f
from math import log
def comb(n, k):
return (f(n) / f(k)) / f(n - k)
def nck(n,k):
return comb(float(n),float(k))
C1 = nck(19,4)*nck(13,3)
print "C1", C1
C2 = nck(13,4)*nck(19,3)
print "C2", C2
print "Total=",C1+C2
print "Logaritmic capacity for 247 letters = ",log(247.0)/log(2.0)
print "Grand total", f(3)*f(4.0)*(C1+C2)
. The real grand total of possible designs is to include the key permutations of the grouping we have already found, thereby adding a factor of 4! \times 3! = 144 to the previous 1.8 million so we get grand total of keypad mapping designs as 259,397,424 or 259 million keyboard combinations in all!

Conclusion: How are we going to find a suitable keypad mapping? Well we may need more heuristics and more cleverness to find the keypad mappings [a few definitely exist in this 259 million possibilities, which maximize a utility function.

So that leads us to the next problem: what is the utility of mapping a Tamil letters in the keypad ? Well – we don’t know apparently, so it doesn’t exist! This also ties into the philosophical question of what is the purpose of all software if not to support use.

ஆமவடை

ஏற்கணவே பதிவு செய்த  இடத்தில் இருந்து தொடருவோம்:

ஆமவடை
படம் 1: ஆமவடை

Corollary 2 of  Theorem 3: ஒரே சொல்லில் எழுத்து இரடிக்கப்பட்டால் அந்த சொல் டோரசில் ஒரு சுழலுடன் [loop] கொண்டபடி அமையும்.

Lemma 2:  படுக்கவசமாகவும், நிமிர்ந்துவசமாகவும் அமைகப்பட்ட சொர்கள் மொழியில் இல்லாதவை.

Corollary 3 or Theorem 3: டோரசில் படுக்கவசமாகவும், நிமிர்ந்துவசமாகவும் பாதைகள்/எழுத்துக்கள் இல்லாதவை.

Theorem 4: ஒரு அகராதியில் உள்ள சொர்கள் அனைத்தையும் டோரசில் பிரதிபலித்தால் அந்த குறுக்கிடும் இடங்களின் [intersecting points] ஒன்று அல்லது மெர்பட்ட சொற்களை] எண்ணிக்கை அளவை மிக குறைவாக்கும் வண்ணம் அமைக்க முடியாது. அதாவது ஒரு அகராதியின் சொற்கள் அனைத்து எவ்வித அமைப்பில் உள்ள டோரசானாலும் சரி அதன் குறுக்கிடும் இடங்களின் எண்ணிக்கை மாராது. இது ஒரு மாறிலி [invariant].

Corollary 1 of Theorem 4: மேர்கண்ட டோரசில் [அதன் ஒரு பிரதிபலிப்பில் – ‘அ,ஆ,இ,ஈ, … ,ஒ,ஓ,ஔ‘ என்றும் ‘கசடதபரயரலவழள – ….’  என்றும் வரிசையிலோ, அல்லது வேறு பரிமாணங்களில்  அடுக்கியிருந்தால்] ஒவ்வொரு அகராதிக்கும் ஒரு சிரப்பான குறுக்கிடும் இடங்களின் எண்ணிக்கை கிடைக்கும். இந்த எண் அகராதியின் கையொப்பம் [signature] என்றும் சொல்லாம்.

Theorem 5: டோரசில் உள்ள ஓவ்வொரு அகராதி சொல்லும் ஒரு பாதை என்று கொள்ளலாம். சொல்லின் தொடக்க எழுத்து  பாதையின் தொடக்கத்தையும், சொல்லின் கடைசி எழுத்து பாதையின் முடிவையும் குறிக்கும்; பாதை திசைகொண்ட பாதையாக இருக்கும் – ஒரு அம்பு தொடக்கத்தில் இருந்து முடிவின் திசையில் வழி காட்டும். ஆகையால் அகராதியில் இல்லாத பாதைகள் பிழையாக எழுதப்பட்ட  அகராதி சொற்களுக்கு சமம், அல்லது அகராதியில் இல்லாத புதிய சொற்களுக்கு சமம்.

வாதம் [ஆதாரத்தின் தொடக்கமாக கருத்ப்படலாம்]:  டோரசில்ஒவ்வொரு சொல்லும் [அதன் பாதையும்] அகராதியில் உள்ள சொற்களாகவே இருக்கவேண்டும். Coding-theory / error correction codes theory படி இவ்வகை சரியான எழுத்துக்கள் உள்ள பாதைகள், சரியான சொற்களாகவும், தவான சொற்கள் [இல்லாத சொற்கள்] பிழையானவை என்வும் அமையும். இவ்வாரான சொற்கள் சரியானவையையின் சொற்பிழை எனவும் கருதப்பாடும்.

Corollary 1 of Theorem 5: மேர்கண்ட டோரசில் முழு அகராதி பிரதிபலிக்கப்பட்டதால், இதனைக்க்கொண்டு ஒரு சொற்பிழை திருத்தி செய்யலாம். பிழையான் சொல்லின் திருத்தம், அதன் நெருங்கிய தொலைவில் உள்ள சரியான் சொல் என்பதை நடைமுரைவிதியாகக்கொண்டு இதனை அமல்படுத்தலாம்.

Theorem 6: Tries எனப்படும் சொல்மரங்களைக்கொண்ட தரவமைப்பை டோரசில் குறியிட்டால், அது தொடர்பாதையாக ஒரே தொடக்கமும், பல பாதைமுடிவுகளையும் கொண்டதாக அமையும். இவற்றில் சில பாதைகள் சேரும் வகையில் முடிவுபெரும் வகையிலும் அமையலாம்.

படம் 2: Trie மரம் என்ற தரவமைப்பு. இதில் ‘to’, ‘tea’, ‘ted’, ‘ten’, ‘A’, ‘in’, மற்றும் ‘inn’ ஆகிய சொற்கள் இடம் பெற்றுள்ளன.

உதாரணத்திற்கு, படம் 2-இல் முடியும் நிலை நுனிகள் ‘n’ என்பவை டோரசில் வரும்பொழுது சேரும் வகையில் முடிவுபெரும் வகையில் அமையும்.

-முத்து.

Project Madurai Corpus – உளி வீரன்

Project Madurai

Project Madurai corpus contains a treasure trove of Tamil data across many generations and inflections of Tamil language. Using this data I post-processed the files in project உளி வீரன்.

Data

We are able to look at data from Project Madurai e-Texts. Currently 4,036,616 total words – 40 lakh plus words –  in ‘plain_text’ folder which contains unigram data and bigram data at word level. One may use open-tamil library to: – discover the unigram word-frequency of this corpus – discover the bi-gram word-frequency of this corpus (since successive words occur in successive lines).

Morse Code for Madurai Corpus

Using the techniques laid out in earlier blog post on Morse Code we are able to regenerate the Morse Code for Tamil using additional data.

Average code word length = 6.65456 bits. Morse code for Tamil using Madurai corpus is displayed below [most frequently occurring symbols to least] – i.e. in descending order.

  1. க -> ..---
  2. ன் -> .--.-
  3. ம் -> .-..-
  4. த -> ----.
  5. த் -> ---.-
  6. க் -> --..-
  7. வ -> -.---
  8. ர் -> -.-.-
  9. ல் -> ....-.
  10. து -> ...--.
  11. ரு -> ...-.-
  12. ப -> ..--.-
  13. ந் -> ..-...
  14. தி -> ..-.--
  15. ப் -> .-----
  16. கு -> .---..
  17. ய -> .--..-
  18. ம -> .-.--.
  19. ட -> --...-
  20. ற் -> --.---
  21. அ -> --.-..
  22. வி -> --.-.-
  23. ர -> -...--
  24. டு -> -...-.
  25. ன -> -..---
  26. ங் -> -..-..
  27. ண் -> -.-...
  28. ட் -> .....--
  29. கி -> .....-.
  30. ள் -> ....---
  31. ல -> ...---.
  32. டி -> ...-...
  33. ற -> ..--..-
  34. யி -> .----.-
  35. று -> .---.--
  36. மு -> .--....
  37. தா -> .--...-
  38. இ -> .-....-
  39. மா -> .-.-..-
  40. பு -> .-.-.-.
  41. ய் -> -------
  42. கா -> ------.
  43. ரி -> -----.-
  44. யா -> ---....
  45. வா -> ---..--
  46. றி -> --.....
  47. சி -> -.....-
  48. லை -> -..--..
  49. ச் -> -..--.-
  50. ச -> -..-.--
  51. யு -> -..-.-.
  52. பி -> -.--...
  53. பா -> -.--.--
  54. உ -> -.-..--
  55. எ -> -.-..-.
  56. னை -> ......--
  57. டை -> ....--..
  58. ள -> ...-----
  59. கொ -> ...-..--
  60. செ -> ..--....
  61. ளி -> ..-..---
  62. ந -> ..-..--.
  63. ண -> ..-.-...
  64. லி -> ..-.-.--
  65. லா -> ..-.-.-.
  66. னி -> .----...
  67. நி -> .---.-..
  68. போ -> .-......
  69. னா -> .-...--.
  70. வே -> .-...-.-
  71. வு -> .-.-----
  72. கை -> .-.----.
  73. னு -> .-.---..
  74. தை -> .-.---.-
  75. மை -> .-.-...-
  76. மி -> .-.-.---
  77. ரை -> .-.-.--.
  78. ளை -> -----...
  79. ழி -> ---...--
  80. ஆ -> ---...-.
  81. லு -> ---..-..
  82. ழு -> --....--
  83. பெ -> --....-.
  84. றை -> --.--...
  85. பொ -> --.--.--
  86. நா -> --.--.-.
  87. ஞ் -> -......-
  88. ரா -> -....---
  89. தே -> -....-..
  90. ணி -> -....-.-
  91. ழ -> -.--..--
  92. சு -> -.--..-.
  93. றா -> -.--.-.-
  94. ழ் -> ........-
  95. வெ -> .......-.
  96. மே -> ......-..
  97. டா -> ......-.-
  98. ளு -> ...----.-
  99. வை -> ...-..-.-
  100. தெ -> ..--...--
  101. யை -> ..-..-..-
  102. கூ -> .----..--
  103. ஒ -> .----..-.
  104. யே -> .---.-.--
  105. தோ -> .---.-.-.
  106. சா -> .-.....-.
  107. தொ -> .-...---.
  108. மெ -> .-...-..-
  109. நீ -> .-.-....-
  110. கோ -> -----..--
  111. கே -> --.--..--
  112. சை -> -........
  113. பே -> -.......-
  114. சொ -> -....--.-
  115. லே -> -.--.-...
  116. யெ -> -.--.-..-
  117. ளா -> .........-
  118. னே -> .......---
  119. ஏ -> ....--.---
  120. வீ -> ....--.--.
  121. பூ -> ....--.-.-
  122. சே -> ...----...
  123. யோ -> ...-..-..-
  124. ழை -> ..--...-.-
  125. நெ -> ..-..-....
  126. தீ -> ..-..-.--.
  127. ணை -> ..-..-.-.-
  128. வ் -> ..-.-..--.
  129. மூ -> .-...-----
  130. றே -> .-...-...-
  131. மொ -> .-.-.....-
  132. கெ -> -----..-.-
  133. ணு -> ---..-.--.
  134. ஓ -> ---..-.-..
  135. சூ -> --.--..-..
  136. தூ -> -....--...
  137. ரே -> .......--..
  138. னெ -> .......--.-
  139. மோ -> ....--.-..-
  140. பை -> ...----..--
  141. சீ -> ...----..-.
  142. மீ -> ...-..-...-
  143. ணா -> ..--...-...
  144. டே -> ..-..-...-.
  145. ஊ -> ..-..-.----
  146. னோ -> ..-..-.---.
  147. ளே -> ..-..-.-..-
  148. வோ -> ..-.-..----
  149. சோ -> ..-.-..---.
  150. நே -> ..-.-..-...
  151. ரெ -> ..-.-..-..-
  152. லோ -> ..-.-..-.--
  153. ஸ் -> ..-.-..-.-.
  154. லெ -> .-.....---.
  155. நோ -> .-.....--..
  156. யொ -> .-...----..
  157. ரோ -> .-...-.....
  158. ஈ -> .-...-....-
  159. றோ -> .-.-.......
  160. நு -> .-.-......-
  161. றெ -> ---..-.----
  162. நூ -> ---..-.---.
  163. கீ -> -....--..-.
  164. ஞா -> ............
  165. ஐ -> ..........--
  166. ஷ -> ..........-.
  167. ழா -> ...-..-.....
  168. டெ -> ..--...-..-.
  169. வொ -> ..-..-...---
  170. ளெ -> ..-..-...--.
  171. ஜ -> ..-..-.-....
  172. றொ -> .-.....-----
  173. ளோ -> .-.....--.--
  174. னொ -> .-.....--.-.
  175. டோ -> .-...----.--
  176. யூ -> -----..-....
  177. ஷ் -> -----..-...-
  178. பீ -> ---..-.-.---
  179. றீ -> ---..-.-.--.
  180. லொ -> ---..-.-.-.-
  181. ரொ -> --.--..-.---
  182. ரீ -> --.--..-.-..
  183. ரூ -> ...........--
  184. ஞ -> ....--.-.....
  185. னீ -> ....--.-...--
  186. டொ -> ...-..-....--
  187. ணீ -> ...-..-....-.
  188. யீ -> ..--...-..---
  189. டீ -> ..--...-..--.
  190. வூ -> .-.....----.-
  191. ணெ -> .-...----.-.-
  192. ஸ -> -----..-..--.
  193. ஜா -> -----..-..-.-
  194. லீ -> --.--..-.--..
  195. ணே -> --.--..-.-.--
  196. னூ -> --.--..-.-.-.
  197. லூ -> -....--..----
  198. நொ -> -....--..--..
  199. ஃ -> -....--..--.-
  200. ளொ -> ...........-.-
  201. ங -> ....--.-...-..
  202. றூ -> ..-..-.-...-..
  203. ணோ -> ..-..-.-...-.-
  204. ஜ் -> .-.....----...
  205. டூ -> .-...----.-...
  206. ஹ -> -----..-..----
  207. ஷி -> -----..-..-..-
  208. நை -> ---..-.-.-...-
  209. ஹா -> ---..-.-.-..--
  210. ளீ -> --.--..-.--.-.
  211. ளூ -> -....--..---.-
  212. ழீ -> ...........-..-
  213. ஜி -> ....--.-....--.
  214. ஸி -> ....--.-....-..
  215. ழே -> ....--.-...-.-.
  216. ஞை -> ..-..-.-...----
  217. கௌ -> ..-..-.-...--.-
  218. மௌ -> .-.....----..--
  219. ணொ -> .-...----.-..--
  220. சௌ -> .-...----.-..-.
  221. ஸா -> -----..-..---.-
  222. ஷா -> -----..-..-...-
  223. ஜெ -> ---..-.-.-.....
  224. வௌ -> ---..-.-.-....-
  225. ஷை -> ---..-.-.-..-..
  226. ஜோ -> --.--..-.--.---
  227. ஜீ -> --.--..-.--.--.
  228. ழெ -> -....--..---...
  229. ஷே -> -....--..---..-
  230. ணூ -> ....--.-....----
  231. ஜை -> ....--.-....---.
  232. ஹி -> ....--.-....-.--
  233. பௌ -> ....--.-...-.---
  234. ஔ -> ..-..-.-...---..
  235. ஞெ -> ..-..-.-...--...
  236. ழூ -> .-.....----..-.-
  237. ழோ -> -----..-..---..-
  238. ழொ -> -----..-..-....-
  239. ஸு -> ---..-.-.-..-.--
  240. ஹோ -> ...........-.....
  241. ஜு -> ...........-...--
  242. ஷு -> ...........-...-.
  243. ஞீ -> ....--.-....-.-..
  244. ஹ் -> ..-..-.-...---.-.
  245. தௌ -> ..-..-.-...---.--
  246. ஸை -> ..-..-.-...--..--
  247. ஜே -> ..-..-.-...--..-.
  248. ஸீ -> -----..-..---...-
  249. ஞி -> -----..-..-.....-
  250. ஸூ -> ...........-....--
  251. ஜொ -> ....--.-....-.-.--
  252. ஹு -> ....--.-...-.--...
  253. ஹை -> ....--.-...-.--..-
  254. ஹீ -> ....--.-...-.--.--
  255. ஸெ -> .-.....----..-....
  256. ஜூ -> .-.....----..-...-
  257. ரௌ -> .-.....----..-..-.
  258. ஹே -> -----..-..---.....
  259. ஸே -> -----..-..-.......
  260. யௌ -> ---..-.-.-..-.-...
  261. ஷூ -> ---..-.-.-..-.-..-
  262. ஹூ -> ---..-.-.-..-.-.--
  263. ஹெ -> ...........-....-..
  264. ஞூ -> ...........-....-.-
  265. ஸோ -> ....--.-...-.--.-..
  266. ஞே -> .-.....----..-..---
  267. ஷீ -> -----..-..---....--
  268. ஷோ -> -----..-..-......--
  269. ஷெ -> -----..-..---....-.
  270. ஹொ -> ---..-.-.-..-.-.-..
  271. ஞோ -> ---..-.-.-..-.-.-.-
  272. ஸௌ -> ....--.-....-.-.-...
  273. டௌ -> ....--.-....-.-.-.--
  274. லௌ -> ....--.-....-.-.-.-.
  275. ஞு -> ....--.-...-.--.-.--
  276. நௌ -> .-.....----..-..--.-
  277. ஙு -> -----..-..-......-..
  278. ஹௌ -> ....--.-....-.-.-..-.
  279. ஸொ -> .-.....----..-..--...
  280. னௌ -> ....--.-...-.--.-.-.-
  281. ஙொ -> ....--.-...-.--.-.-..
  282. ஞௌ -> .-.....----..-..--..-
  283. ஞொ -> ....--.-....-.-.-..---
  284. ஙா -> -----..-..-......-.---
  285. ஙே -> -----..-..-......-.-..
  286. ளௌ -> ....--.-....-.-.-..--..
  287. ஷொ -> -----..-..-......-.-.--
  288. ழௌ -> -----..-..-......-.--..
  289. ஙூ -> -----..-..-......-.-.-.
  290. ஷௌ -> -----..-..-......-.--.--
  291. றௌ -> -----..-..-......-.--.-.
  292. ஙோ -> ....--.-....-.-.-..--.--
  293. ஙி -> ....--.-....-.-.-..--.-.

We are able to say this Morse code book is a better representation of Tamil since it finds 290 letters incident of the 323 letters in Grantha + Tamil letter set generated from the Madurai corpus of 4 million words.

 

Tamil in Morse-code

Can we compose a Tamil Morse-code ? Yes, we can.

315px-International_Morse_Code.svg
International Morse Code – Source: Wikipedia

  1. Start with a frequency count of Tamil letters from various sources
  2. Build a probability distribution from the frequency counts
  3. Build a Huffman code using the above distribution
  4. Each letter of Tamil alphabet gets a Morse code : 0 = ‘.’, 1 – ‘-‘.
    புள்ளி, கோடு.

Tamil Morse Code Table generated from Open-Tamil library. See here for full code and methodology. Full table follows.

Can you decode what this Morse code means in Tamil ? Hint: 2 words (4,5) letters long

...-. --.--.. .---..--.--- .-..-. ...-. ---.-. -----.--.- .--....- ..-..-

Please note table was updated to show letters in most-frequent to least-frequent alphabets and their code-words used. Updated after publishing on Aug 16th, 2018.

Source coding theory

Information theory provides us with tools to calculate the information content of symbols in a language, i.e. alphabets in our case. Average codeword length was 6.45652 bits, which is rounded to 7bits.
According to 230+ symbols of encoded in binary without attention to letter frequency we would be using ceil[ log2[230] ] ~ 8bits per symbol, so the usage of Morse code provides a related data compression of 12.5%!

Previously, I had written about Morse code for Tamil in this blog here, and relationship with Unigram, Bigram and Trigram models and word-structure in Tamil language.

  1. ம் -> --..
  2. த -> -...
  3. க -> ...-.
  4. ல் -> ..---
  5. த் -> ----.
  6. க் -> -.---
  7. ன் -> -.--.
  8. ர -> .....-
  9. ப -> ....--
  10. வ -> ..--.-
  11. தி -> ..-..-
  12. ச -> ..-.-.
  13. கு -> .----.
  14. ம -> .---.-
  15. ப் -> .--..-
  16. ட் -> .--.-.
  17. டு -> .-...-
  18. ர் -> .-..-.
  19. ய -> .-.-.-
  20. அ -> ---..-
  21. ட -> ---.--
  22. ரு -> ---.-.
  23. பு -> -..---
  24. கா -> -..--.
  25. து -> -..-.-
  26. ல -> -.-..-
  27. வி -> .......
  28. டி -> ....-..
  29. ண் -> ....-.-
  30. சி -> ...---.
  31. ன -> ..--...
  32. ரி -> ..-....
  33. ங் -> ..-...-
  34. ந் -> ..-.---
  35. ற் -> .-----.
  36. இ -> .--...-
  37. று -> .-..---
  38. ச் -> .-....-
  39. சு -> .-..--.
  40. பா -> .-.----
  41. கி -> .-.--..
  42. பி -> .-.--.-
  43. வா -> .-.-...
  44. மு -> -----..
  45. ள் -> ---....
  46. லை -> --.--..
  47. உ -> --.--.-
  48. டை -> --.-..-
  49. தா -> --.-.--
  50. ண -> -..-...
  51. கை -> -..-..-
  52. ஆ -> -.-...-
  53. மா -> -.-.---
  54. ய் -> -.-.-.-
  55. ள -> ......-.
  56. சா -> ...--..-
  57. ற -> ...--.--
  58. லி -> ..--..--
  59. வு -> .---...-
  60. கொ -> .---..-.
  61. ந -> .--.....
  62. நி -> .--....-
  63. ஞ் -> .--.----
  64. ரா -> .--.---.
  65. ணி -> .--.--..
  66. ளி -> .--.--.-
  67. யா -> .-......
  68. நா -> .-.-..--
  69. றி -> .-.-..-.
  70. கோ -> -------.
  71. செ -> ------..
  72. ழி -> ------.-
  73. னி -> -----.-.
  74. ழு -> --.-----
  75. மி -> --.----.
  76. யி -> --.-....
  77. பொ -> --.-.-..
  78. ரை -> --.-.-.-
  79. வெ -> -.-.....
  80. எ -> -.-.--..
  81. மை -> -.-.--.-
  82. றை -> -.-.-..-
  83. பூ -> ......--.
  84. ழ -> ...-----.
  85. னை -> ...----..
  86. லா -> ...--.-..
  87. சை -> ..--..-.-
  88. வை -> ..-.--...
  89. போ -> ..-.--..-
  90. கூ -> ..-.--.-.
  91. வே -> .--------
  92. டா -> .-------.
  93. தை -> .------..
  94. பெ -> .---....-
  95. ளை -> .---..---
  96. தே -> .-.---...
  97. ஒ -> .-.---.--
  98. ழ் -> -----.---
  99. லு -> ---...---
  100. நீ -> ---...-..
  101. சீ -> ---...-.-
  102. தீ -> --.---...
  103. மூ -> --.---..-
  104. தொ -> --.---.--
  105. ணை -> --.---.-.
  106. ஏ -> --.-...-.
  107. நெ -> -.-....-.
  108. ளு -> -.-.-....
  109. னா -> ......----
  110. சூ -> ......---.
  111. மே -> ...-------
  112. தோ -> ...------.
  113. தெ -> ...----.-.
  114. சொ -> ...--.....
  115. சே -> ...--....-
  116. தூ -> ...--...--
  117. யு -> ...--...-.
  118. பே -> ...--.-.--
  119. வீ -> ..--..-..-
  120. ஊ -> .------.--
  121. னு -> .---......
  122. யோ -> .---.....-
  123. சோ -> .---..--..
  124. கே -> .-.....---
  125. ழை -> .-.....--.
  126. ணு -> .-.---..--
  127. ஓ -> .-.---.-..
  128. கெ -> ----------
  129. கீ -> --------..
  130. றா -> --------.-
  131. பை -> -----.--..
  132. ணா -> -----.--.-
  133. ரோ -> ---...--.-
  134. மொ -> -.-....--.
  135. மெ -> -.-.-...--
  136. லோ -> ...----.---
  137. பீ -> ...----.--.
  138. ளா -> ...--.-.-.-
  139. ஈ -> ..--..-....
  140. ஞா -> ..--..-...-
  141. மீ -> ..-.--.----
  142. வ் -> ..-.--.--..
  143. மோ -> ..-.--.--.-
  144. நு -> .---..--.-.
  145. ஐ -> .-.....-..-
  146. ரே -> .-.....-.-.
  147. நோ -> .-.---..-.-
  148. நே -> .-.---.-.--
  149. நூ -> ---------..
  150. யெ -> --.-...----
  151. லே -> --.-...--..
  152. ரீ -> -.-....----
  153. நொ -> -.-....---.
  154. யை -> -.-.-...-..
  155. ழா -> ...--.-.-...
  156. ரூ -> ...--.-.-..-
  157. னோ -> .------.-.--
  158. ஞ -> .---..--.---
  159. யூ -> .---..--.--.
  160. வோ -> .-.....-....
  161. யே -> .-.....-.---
  162. லெ -> .-.---..-...
  163. ரெ -> .-.---.-.-.-
  164. ணீ -> ---...--....
  165. டோ -> ---...--..--
  166. டெ -> ---...--...-
  167. கௌ -> ---...--..-.
  168. ணெ -> --.-...---..
  169. சௌ -> --.-...---.-
  170. றெ -> ..-.--.---...
  171. லூ -> ..-.--.---..-
  172. றோ -> .------.-....
  173. னே -> ..-.--.---.--
  174. னீ -> .------.-..-.
  175. நை -> .------.-..--
  176. டூ -> .------.-.-..
  177. னெ -> .-.....-.--..
  178. டே -> .-.....-.--.-
  179. ஞெ -> .-.---..-..--
  180. ளெ -> .-.---.-.-...
  181. டீ -> ---------.---
  182. யொ -> ---------.--.
  183. பௌ -> ---------.-..
  184. ஃ -> --.-...--.---
  185. ஔ -> --.-...--.-..
  186. ஞை -> -.-.-...-.---
  187. யீ -> -.-.-...-.--.
  188. றொ -> -.-.-...-.-.-
  189. வொ -> .------.-...--
  190. வூ -> ..-.--.---.-..
  191. னூ -> .------.-.-.--
  192. ளோ -> .-.....-...---
  193. ணோ -> .------.-.-.-.
  194. றே -> .-.....-...--.
  195. மௌ -> .-.....-...-..
  196. தௌ -> .-.---..-..-..
  197. ளே -> .-.---.-.-..-.
  198. லொ -> .-.---.-.-..--
  199. றூ -> ---------.-.--
  200. ரொ -> --.-...--.--..
  201. டொ -> --.-...--.-.-.
  202. ங -> -.-.-...-.-...
  203. ணே -> ..-.--.---.-.--
  204. ளீ -> .------.-...-..
  205. ழூ -> .-.....-...-.-.
  206. ளொ -> .-.---..-..-.-.
  207. ரௌ -> .-.---..-..-.--
  208. யௌ -> ---------.-.-..
  209. னொ -> ---------.-.-.-
  210. ழோ -> --.-...--.-.--.
  211. ளூ -> --.-...--.-.---
  212. ஞி -> -.-.-...-.-..--
  213. ணொ -> .-.....-...-.---
  214. ணூ -> .------.-...-.--
  215. ழீ -> .-.....-...-.--.
  216. ஸ் -> --.-...--.--.--.
  217. வௌ -> -.-.-...-.-..-..
  218. ஞீ -> --.-...--.--.---
  219. ஷ் -> ..-.--.---.-.-...
  220. ஷி -> ..-.--.---.-.-..-
  221. ழெ -> ..-.--.---.-.-.-.
  222. றீ -> .------.-...-.-.-
  223. நௌ -> ..-.--.---.-.-.--
  224. ஞே -> .------.-...-.-..
  225. லௌ -> --.-...--.--.-..-
  226. ஞொ -> -.-.-...-.-..-.--
  227. ஙு -> --.-...--.--.-...
  228. ஷ -> --.-...--.--.-.---
  229. ழொ -> --.-...--.--.-.--.
  230. ழே -> -.-.-...-.-..-.-.
  231. டௌ -> --.-...--.--.-.-.-
  232. ஞூ -> --.-...--.--.-.-..

Caveats and Closing Comments

Of course 15 of 247 letters are perhaps not received any codeword in this codebook. Further with inclusion of Grantha letters, 323 letters exist in Tamil some of which we don’t have code words.

Further, a large text corpus like Project Madurai’s [PM] unigram frequency distribution maybe useful to develop a widely representative Morse code table. Once you have this PM unigram data, you know how to get this Tamil Morse codebook regenerated!