diff --git a/CHANGES.txt b/CHANGES.txt
new file mode 100644
index 0000000..32c5a2f
--- /dev/null
+++ b/CHANGES.txt
@@ -0,0 +1 @@
+v<0.1>, <2012-01-09> -- Initial release.
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..58b2c5a
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,186 @@
+GNU AFFERO GENERAL PUBLIC LICENSE
+
+Version 3, 19 November 2007
+
+Copyright 2007 Free Software Foundation, Inc.
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
+
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
+
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+
+0. Definitions.
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License.
+Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
diff --git a/amuthaa/CHANGES.txt b/amuthaa/CHANGES.txt
new file mode 100644
index 0000000..32c5a2f
--- /dev/null
+++ b/amuthaa/CHANGES.txt
@@ -0,0 +1 @@
+v<0.1>, <2012-01-09> -- Initial release.
diff --git a/amuthaa/Chol.py b/amuthaa/Chol.py
new file mode 100644
index 0000000..9943d33
--- /dev/null
+++ b/amuthaa/Chol.py
@@ -0,0 +1,179 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+# import Ezhuthu class
+from Ezhuthu import Ezhuthu
+
+
+# Add skeletal outline for functions. Removed redundant function. Modified import command
+
+class Chol:
+ """
+ Module to handle the processing of Tamil words
+ """
+
+ def __init__(self, text=u''):
+ """ Constructor for Chol class. Takes a unicode string composed of Tamil characters as an optional input. """
+
+ self._text = u''
+ self._syllables = []
+ self._letters = []
+
+ # if text is entered, call the text property's setter (which generates the syllables and letters lists)
+ if text: self.text(text)
+
+
+ def __getitem__(self,index):
+ """ Read the letter at the given position in the letters list """
+
+ self._letters[index]
+
+
+ def __setitem__(self, index, value):
+ """ Modify a member at the given position in the letters list """
+
+ self._letters[index] = value
+
+
+ @property
+ def text(self):
+ return self._text
+
+ @text.setter
+ def text(self, text):
+
+ # if valid text is entered, calculate syllables and letters
+
+ if self.validate():
+ self.text = text
+
+ self._letters = self.split_letters(text)
+ #TODO: calculate syllables
+
+ # if invalid text is entered, initialize to empty string
+ else:
+ self.text = u''
+
+
+ @property
+ def syllables(self):
+ return self._syllables
+
+ @property
+ def letters(self):
+ return self._letters
+
+
+ def validate(self):
+ """ Checks whether the given word is valid """
+
+ # simple test: every element of the string has to be a valid Tamil character
+ for codepoint in self.text:
+ Ezhuthu.validate_letter(codepoint)
+
+
+ #TODO: implement method this more thoroughly
+ #TODO: check for pulli or combination_ending at the beginning of a word
+
+ return True
+
+
+ @staticmethod
+ def split_letters(word=u''):
+ """ Returns the graphemes (i.e. the Tamil characters) in a given word as a list """
+
+ # ensure that the word is a valid word
+ Chol.validate_word(word)
+
+ # list (which will be returned to user)
+ letters = []
+
+ # a tuple of all combination endings and of all அ combinations
+ combination_endings = Ezhuthu.get_combination_endings()
+ a_combinations = Ezhuthu.get_combination_column(u'அ').values()
+
+ # loop through
+ for codepoint in word:
+
+ # if codepoint is an அ combination, a vowel, aytham or a space, add it to the list
+ if codepoint in a_combinations or Ezhuthu.is_whitespace(codepoint) or Ezhuthu.is_vowel(codepoint) or Ezhuthu.is_aytham(codepoint):
+ letters.append(codepoint)
+
+ # if codepoint is a combination ending or a pulli ('்'), add it to the end of the previously-added codepoint
+ elif codepoint in combination_endings or codepoint==Ezhuthu.get_pulli():
+
+ # ensure that at least one character already exists
+ if len(letters) > 0:
+ letters[-1] = letters[-1] + codepoint
+
+ # otherwise raise an Error. validate_word() should catch this, however
+ else:
+ raise ValueError("Unknown error: The combination ending %s cannot be the first character of a word" %(codepoint))
+
+ # if codepoint was neither a vowel, aytham, a pulli or a combination ending, an unexpected error has occurred
+ else:
+ raise ValueError("Unknown error: The codepoint \'%s\' in word %s is neither a vowel, consonant, combination or aytham" %(codepoint, word))
+
+
+ #TODO: Write extensive test cases for this
+
+ return letters
+
+ @staticmethod
+ def print_letters(word = u'', delimiter="-"):
+ """ Prints all the graphemes in a word, separated by a delimiter (default: "-") """
+
+ for letter in Chol.get_letters(word):
+ print letter, delimiter,
+
+ # go to new line
+ print
+
+
+ @staticmethod
+ def split_syllables(letters = []):
+ """ Returns the syllables in a given word as a list """
+
+ ## Generic algorithm:
+ ## Each vowel and combination is its own syllable. Consonants and aytham get added to the end of the previous syllable
+
+ # ensure that the word is a valid word
+ Chol.validate_word(''.join(letters))
+
+ # initialize empty list
+ syllables = []
+
+ # loop through letters in the word
+ for letter in letters:
+
+ # if letter is a vowel or combination, it gets its own syllable
+ if Ezhuthu.is_combination(letter) or Ezhuthu.is_vowel(letter):
+ syllables.append(letter)
+
+ # if codepoint is a consonant or aytham, add it to the end of the previously-added codepoint
+ elif Ezhuthu.is_consonant(letter) or Ezhuthu.is_aytham(letter):
+
+ # ensure that at least one character already exists
+ if len(syllables) > 0:
+ syllables[-1] = syllables[-1] + letter
+
+ # if the first letter is a consonant (probably b/c it' s a loanword), add it to the beginning of the string
+ else:
+ syllables.append(letter)
+
+ # if codepoint was neither a vowel, aytham, a pulli or a combination ending, an unexpected error has occurred
+ else:
+ raise Exception("Unknown error: The letter \'%s\' in word %s is neither a vowel, consonant, combination or aytham" %(letter, ''.join(letters)))
+
+
+ #TODO: Write extensive test cases for this
+
+
+
+
+
+
+
+
+
+
diff --git a/amuthaa/EzhuthUrai.py b/amuthaa/EzhuthUrai.py
new file mode 100644
index 0000000..33d0072
--- /dev/null
+++ b/amuthaa/EzhuthUrai.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+class EzhuthUrai:
+ """
+ A module to handle the processing of Tamil passages (from sentences to short stories)
+ """
+
+ #TODO: Implement this
+ pass
\ No newline at end of file
diff --git a/amuthaa/Ezhuthu.py b/amuthaa/Ezhuthu.py
new file mode 100644
index 0000000..96bcd67
--- /dev/null
+++ b/amuthaa/Ezhuthu.py
@@ -0,0 +1,503 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+import unicodedata
+import string
+
+class Ezhuthu:
+ """
+ Module to handle Tamil letter processing
+ """
+
+ ## Declare static variables
+
+
+ VOWEL_TO_ENDING_MAP = {
+ u'அ' : u'', # அ -> '' (empty string)
+ u'ஆ' : u'\u0BBE', # ஆ -> ா
+ u'இ' : u'\u0BBF', # இ -> ி
+ u'ஈ' : u'\u0BC0', # ஈ -> ீ
+ u'உ' : u'\u0BC1', # உ -> ு
+ u'ஊ' : u'\u0BC2', # ஊ -> ூ
+ u'எ': u'\u0BC6', # எ -> ெ
+ u'ஏ' : u'\u0BC7', # ஏ -> ே
+ u'ஐ' : u'\u0BC8', # ஐ -> ை
+ u'ஒ' : u'\u0BCA', # ஒ -> ொ
+ u'ஓ' : u'\u0BCB', # ஓ -> ோ
+ u'ஔ' : u'\u0BCC' # ஔ -> ௌ
+ }
+
+ # create an inverse map as well
+ ENDING_TO_VOWEL_MAP = dict((ending, vowel) for vowel, ending in VOWEL_TO_ENDING_MAP.iteritems() if ending!=u'')
+
+ # create vowel ending list from the dictionary's keys and values
+ COMBINATION_ENDINGS = ENDING_TO_VOWEL_MAP.keys()
+
+ PULLI = u'்'
+
+ AYTHAM = u'ஃ'
+
+ CONSONANTS = {
+ 'VALLINAM' : (u'க்', u'ச்', u'ட்', u'த்', u'ப்', u'ற்'),
+ 'MELLINAM' : (u'ங்', u'ஞ்', u'ண்', u'ந்', u'ம்', u'ன்'),
+ 'IDAIYINAM' : (u'ய்',u'ர்', u'ல்', u'வ்', u'ழ்', u'ள்'),
+
+ ## Removing support for 'க்ஷ்' and 'ஶ்' temporarily
+ #TODO: Add support for 'க்ஷ்', 'ஶ்'
+ #'GRANTHA' : (u'ஶ்', u'ஜ்', u'ஷ்', u'ஸ்', u'ஹ்', u'க்ஷ்')
+ 'GRANTHA' : (u'ஜ்', u'ஷ்', u'ஸ்', u'ஹ்')
+ }
+
+ VOWELS = {
+ 'KURIL' : (u'அ', u'இ', u'உ', u'எ', u'ஒ'),
+ 'NEDIL' : (u'ஆ', u'ஈ', u'ஊ', u'ஏ', u'ஐ', u'ஓ', u'ஔ')
+ }
+
+
+
+
+ @staticmethod
+ def get_script_name(letter = u''):
+ """ Returns the name of the script that the unicode character is encoded in """
+
+ return unicodedata.name(letter[0]).split()[0]
+
+
+ @staticmethod
+ def validate_letter(letter = u''):
+ """
+ Ensures that letter is of type unicode, is not equal to an empty string and is a Tamil letter (according to the Unicode consortium).
+ If one of these conditions is not met, an Exception is raised. If all of them are met, True is returned
+ """
+
+ # Check for non-unicode objects
+ if not isinstance(letter, unicode):
+ raise TypeError("Must be unicode string. Value \'%s\' of type %s received" %(letter, type(letter)))
+
+ # Check for empty strings
+ if len(letter)==0:
+ raise ValueError("Expected a Unicode character. Empty string received.")
+
+ # Check for non-Tamil, non-whitespace characters
+ script_language = Ezhuthu.get_script_name(letter).title()
+ if script_language != 'Tamil' and not Ezhuthu.is_whitespace(letter):
+ raise ValueError("Expected a Tamil character or whitespace. \'%s\' is from the %s script" %(letter, script_language))
+
+ # TODO: for more than one character
+
+ # TODO: Allow punctuation and digits
+
+ # If we've gotten this far, everything seems to be alright
+ return True
+
+
+
+ ## Getter methods for aytham, vowels, consonants and combinations
+
+ @staticmethod
+ def get_aytham():
+ """ Returns a single unicode letter - aytham """
+
+ return Ezhuthu.AYTHAM
+
+ @staticmethod
+ def get_vowels():
+ """ Returns a tuple of all the vowels """
+
+ # get keys from VOWEL_TO_ENDING_MAP and convert to tuple
+ return tuple(Ezhuthu.VOWEL_TO_ENDING_MAP.keys())
+
+ @staticmethod
+ def get_consonants():
+ """ Returns a tuple of all the consonants """
+
+ # merge all sub-iterables in CONSONANTS into one tuple
+ return tuple(consonant for consonant_group in Ezhuthu.CONSONANTS.values() for consonant in consonant_group)
+
+ @staticmethod
+ def get_letter_type(letter = u''):
+ """ Returns the letter type: Vowel, Consonant or Combination """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ if Ezhuthu.is_vowel(letter):
+ return 'VOWEL'
+ elif Ezhuthu.is_consonant(letter):
+ return 'CONSONANT'
+ elif Ezhuthu.is_combination(letter):
+ return 'COMBINATION'
+ elif Ezhuthu.is_aytham(letter):
+ return 'AYTHAM'
+ else:
+ raise Exception("Unknown error. Letter \'%s\' is coming up as neither a vowel, consonant or combination" %letter)
+
+ @staticmethod
+ def is_aytham(letter = u''):
+ """
+ Checks whether the given letter is the Aytha Ezhuthu (ஃ)
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ return letter == Ezhuthu.get_aytham()
+
+
+ ## Boolean methods to check whether a given letter is aytham, a vowel, a consonant or a combination
+
+ @staticmethod
+ def is_vowel(letter = u''):
+ """
+ a character is a vowel if it has a length of one and if its value is between
+ 2949 (அ) and 2964 (ஔ)
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ return len(letter)==1 and (ord(u'அ') <= ord(letter) <= ord(u'ஔ'))
+
+ @staticmethod
+ def is_consonant(letter = u''):
+ """
+ a character is a consonant if it has a length of two and its
+ second (and last) character is the pulli (்)
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ return (len(letter)==2 and (letter[1] == u'்')) and (ord(u'க') <= ord(letter[0]) <= ord(u'ஹ'))
+
+ @staticmethod
+ def is_combination(letter = u''):
+ """
+ Check whether a letter is a combination or not
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # a letter is a combination if it has exactly two characters, the first of which is in the 'அ' column,
+ # and the second of which is a combination ending ( ே, ி, etc.)
+ return (ord(u'க') <= ord(letter[0]) <= ord(u'ஹ')) and (len(letter)==1 or (len(letter)==2 and letter[1] in Ezhuthu.COMBINATION_ENDINGS))
+
+
+ @staticmethod
+ def is_kuril(letter = u''):
+ """
+ A character is 'kuril' if it is a vowel or combination with a short sound.
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # retrieve the vowel component of the letter and check if it's a kuril sound
+ _, vowel = Ezhuthu.split_combination(letter)
+ return vowel in Ezhuthu.VOWELS['KURIL']
+
+
+ @staticmethod
+ def is_nedil(letter = u''):
+ """ a character is 'nedil' if it is a vowel or combination with a long sound.
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # retrieve the vowel component of the letter and check if it's a nedil sound
+ _, vowel = Ezhuthu.split_combination(letter)
+ return vowel in Ezhuthu.VOWELS['NEDIL']
+
+
+ @staticmethod
+ def get_vowel_type(letter = u''):
+ """
+ Returns the vowel type (i.e. 'KURIL' or 'NEDIL')
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # ensure that the letter is a vowel or combination
+ if not Ezhuthu.is_vowel(letter) and not Ezhuthu.is_combination(letter):
+ raise ValueError("Vowel or combination expected, but the letter \'%s\' is a %s" %(letter, Ezhuthu.get_letter_type(letter).title()))
+
+ # if letter is a combination, split out the vowel part
+ _, vowel = Ezhuthu.split_combination(letter)
+
+ # retrieve and return the vowel type
+ for vowel_type in Ezhuthu.VOWELS:
+ if vowel in Ezhuthu.VOWELS[vowel_type]:
+ return vowel_type
+
+ # if we got this far, an unknown error occurred
+ raise Exception("Unknown error. Letter \'%s\' is coming up as neither kuril nor nedil" %letter)
+
+
+ @staticmethod
+ def is_vallinam(letter = u''):
+ """
+ Checks whether or not a given letter is vallinam
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if not consonant, it is not a vallinam consonant
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a hard consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['VALLINAM']
+
+ @staticmethod
+ def is_mellinam(letter = u''):
+ """
+ Checks whether or not a given letter is mellinam
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a soft consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['MELLINAM']
+
+ @staticmethod
+ def is_idaiyinam(letter = u''):
+ """
+ Checks whether or not a given letter is idaiyinam
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if not consonant, it is not an idaiyinam consonant
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a medium consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['IDAIYINAM']
+
+ @staticmethod
+ def is_grantha(letter = u''):
+ """
+ Checks whether or not a given letter is grantha
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if not a consonant, it is not a grantha consonant
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a grantha consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['GRANTHA']
+
+
+ @staticmethod
+ def is_whitespace(letter = u''):
+ """ Checks whether or not a given letter is whitespace (e.g. a space, tab, etc.) """
+
+ #TODO: write test cases for this
+ return len(letter)>0 and (letter.isspace() or unicodedata.category(letter)[0].upper()==u'Z')
+
+
+ @staticmethod
+ def is_punctuation(letter = u''):
+ """ Checks whether or not a given letter is punctuation """
+
+ #TODO: write test cases for this
+ #TODO: string.punctuation contains some symbols, so the condition below will return false positives
+ return letter in string.punctuation or unicodedata.category(letter)[0].upper() in ('P')
+
+
+ @staticmethod
+ def is_digit(letter = u''):
+ """ Checks whether or not a given letter is a digit """
+
+ #TODO: write test cases for this
+ return letter.isnumeric() or letter.isdecimal() or unicodedata.category(letter[0]).upper() in ('N')
+
+
+ @staticmethod
+ def is_symbol(letter = u''):
+ """ Checks whether or not a given letter is a symbol """
+
+ #TODO: write test cases for this
+ #TODO: See if the python string function has anything for handling this
+ return unicodedata.category(letter)[0].upper() in ('S')
+
+
+ @staticmethod
+ def get_consonant_type(letter = u''):
+ """
+ Returns the consonant type (i.e. 'VALLINAM', 'MELLINAM', 'IDAIYINAM' or 'GRANTHA')
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # ensure that the letter is a vowel
+ if not Ezhuthu.is_consonant(letter):
+ raise ValueError("Consonant expected, but the letter \'%s\' is a %s" %(letter, Ezhuthu.get_letter_type(letter).title()))
+
+ # retrieve and return the vowel type
+ for consonant_type in Ezhuthu.CONSONANTS:
+ if letter in Ezhuthu.CONSONANTS[consonant_type]:
+ return consonant_type
+
+ # if we got this far, an unknown error occurred
+ raise Exception("Unknown error. Letter \'%s\' is coming up as neither kuril nor nedil" %letter)
+
+
+ @staticmethod
+ def get_combination(consonant=u'', vowel=u''):
+ """
+ Returns a combination given a vowel and a consonant
+ """
+
+ # ensure that the consonant and vowel are valid single Tamil unicode graphemes
+ Ezhuthu.validate_letter(consonant)
+ Ezhuthu.validate_letter(vowel)
+
+ if not Ezhuthu.is_consonant(consonant):
+ raise ValueError("Consonant expected. \'%s\' is not a consonant" %consonant)
+
+ if not Ezhuthu.is_vowel(vowel):
+ raise ValueError("Vowel expected. \'%s\' is not a vowel" %(vowel))
+
+ # store combination initially as an array
+ combination = []
+
+ # combination = first part of consonant (i.e. the அ-column, plus the extension)
+ combination.append(consonant[0])
+ combination.append(Ezhuthu.VOWEL_TO_ENDING_MAP[vowel])
+
+ return ''.join(combination)
+
+
+
+ @staticmethod
+ def split_combination(letter=u''):
+ """
+ Returns a consonant, vowel tuple when given a combination
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if consonant, no vowel in the tuple
+ if Ezhuthu.is_consonant(letter):
+ return letter, u''
+
+ # if vowel, no consonant in the tuple
+ elif Ezhuthu.is_vowel(letter):
+ return u'', letter
+
+ # if combination ending with -அ, return அ
+ elif len(letter)==1 and (ord(u'க') <= ord(letter) <= ord(u'ஹ')):
+ return letter+Ezhuthu.get_pulli(), u'அ'
+
+ # if non-அ combination, separate the vowel from the extension and return it
+ elif len(letter)==2 and Ezhuthu.is_combination(letter):
+
+ # the consonant is the first part, plus the pulli
+ consonant = []
+ consonant.append(letter[0])
+ consonant.append(Ezhuthu.PULLI)
+ consonant = ''.join(consonant) # convert to string
+
+ # get vowel using the extension
+ vowel = Ezhuthu.ENDING_TO_VOWEL_MAP[letter[1]]
+
+ # return the (consonant, vowel) tuple
+ return consonant, vowel
+
+ # if aytham, return empty unicode strings for both vowel and consonant
+ elif Ezhuthu.is_aytham(letter):
+ return u'', u''
+
+ else:
+ raise Exception("An unknown exception occurred for letter %s." %letter)
+
+
+ @staticmethod
+ def get_combination_column(vowel = u''):
+ """
+ Returns a dictionary of combinations for a particular vowel, mapped by consonant
+ """
+ ## Ensure that letter is a valid Tamil unicode character and a vowel
+ Ezhuthu.validate_letter(vowel)
+
+ if not Ezhuthu.is_vowel(vowel):
+ raise ValueError("Vowel required. \'%s\' is a %s" %(vowel, Ezhuthu.get_letter_type(vowel).title()))
+
+
+ # Declare empty dictionary
+ combination_col = {}
+
+ # For each vowel, determine the respective consonant-vowel combination and add it to the dictionary object
+ for consonant in Ezhuthu.get_consonants():
+
+ # The first letter of the combination is the அ combination for the consonant
+ # The second is an extension, which is obtained from the VOWEL_TO_ENDING_MAP
+ combination = consonant[0]+Ezhuthu.VOWEL_TO_ENDING_MAP[vowel]
+ combination_col.update({consonant : combination})
+
+
+ return combination_col
+
+
+ @staticmethod
+ def get_combination_row(consonant = u''):
+ """
+ Returns a dictionary of combinations for a particular consonant, mapped by vowel
+ """
+
+ ## Ensure that letter is a valid Tamil unicode character and a consonant
+ Ezhuthu.validate_letter(consonant)
+
+ if not Ezhuthu.is_consonant(consonant):
+ raise ValueError("Consonant required. \'%s\' is a %s" %(consonant, Ezhuthu.get_letter_type(consonant).title()))
+
+
+ # Declare empty dictionary
+ combination_row = {}
+
+ # For each vowel, determine the respective consonant-vowel combination and add it to the dictionary object
+ for vowel in Ezhuthu.get_vowels():
+
+ # The first letter of the combination is the அ combination for the consonant
+ # The second is an extension, which is obtained from the VOWEL_TO_ENDING_MAP
+ combination = consonant[0]+Ezhuthu.VOWEL_TO_ENDING_MAP[vowel]
+ combination_row.update({vowel : combination})
+
+
+ return combination_row
+
+ @staticmethod
+ def get_combination_endings():
+ """ Returns a tuple of vowel combination endings (ி ,ீ , ே, etc.) """
+
+ #TODO: create a test case for this
+
+ # get the list of combination endings, remove the empty unicode string and convert to a tuple
+ return tuple(Ezhuthu.COMBINATION_ENDINGS)
+
+
+ @staticmethod
+ def get_pulli():
+ """ Returns the pulli codepoint ('்') """
+
+ #TODO: Create a test case for this
+
+ return Ezhuthu.PULLI
+
+
+
diff --git a/amuthaa/LICENSE.txt b/amuthaa/LICENSE.txt
new file mode 100644
index 0000000..58b2c5a
--- /dev/null
+++ b/amuthaa/LICENSE.txt
@@ -0,0 +1,186 @@
+GNU AFFERO GENERAL PUBLIC LICENSE
+
+Version 3, 19 November 2007
+
+Copyright 2007 Free Software Foundation, Inc.
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
+
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
+
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+
+0. Definitions.
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License.
+Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
diff --git a/amuthaa/Noun.py b/amuthaa/Noun.py
new file mode 100644
index 0000000..38ab2c8
--- /dev/null
+++ b/amuthaa/Noun.py
@@ -0,0 +1,135 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+from Ezhuthu import Ezhuthu
+from Chol import Chol
+
+# Suffix dictionary: maps suffix to வேற்றுமை type
+SUFFIX = {
+ u'ஐ' : 1,
+ u'ஆல்' : 2,
+ u'ஓடு' : 2,
+ u'உடன்' : 2,
+ u'கு' : 4,
+ u'இல்' : 5,
+ u'இன்' : 5,
+ u'ஐ விட' : 5,
+ # u' இனின்று' : 5, - commented this out. Never heard of it
+ u'இலிருந்து' : 5,
+ u'அது' : 6,
+ u'ஆது' : 6,
+ u'அ' : 6,
+ u'உடைய' : 6,
+ u'இனுடைய' : 6,
+ u'இல்' : 7,
+ u'இடத்தில்' : 7,
+ u'மேல்' : 7,
+ u'இன்மேல்' : 7,
+ u'கீழ்' : 7,
+ u'இன்கீழ்' : 7,
+ u'உள்' : 7,
+ u'கு உள்' : 7,
+ u'உம்' : 0,
+ u'ஆ' : 0,
+ u'ஏ' : 0,
+ u'ஓ' : 0
+ }
+
+
+class Noun(Chol):
+
+
+
+ def __init__(self, text=u''):
+ self._noun_class = None
+
+
+ @staticmethod
+ def validate_class(noun_class = 0):
+ """ docstring """
+
+
+ #TODO: implement method
+
+ @staticmethod
+ def get_class(word = u''):
+ """ Returns the noun class for a given word """
+
+ ### See flowchart in docs/material/sendhil/noun_classes.png for more details
+
+ word = Chol(word)
+
+ ## For noun classes ending in a consonant:
+ ## Ending in ம் -> class 1
+ ## Ending in ல், ன், ய், ள், ண் AND has exactly two graphemes AND first letter is kuril: class 2
+ ## All other consonant-ending nouns -> class 3
+
+ if Ezhuthu.is_consonant(word[-1]):
+
+ if word[-1] == u'ம்':
+ return 1
+
+ elif word[-1] in (u'ல்', u'ன்', u'ய்', u'ள்', u'ண்') and len(word)==2 and Ezhuthu.is_kuril(word[0]):
+ return 2
+
+ else:
+ return 3
+
+ ## For noun classes not ending in a combination:
+ ## TODO: What if a noun ends in Aytham?
+ ## TODO: Has this been tested on one-letter long all-vowel nouns (e.g. ஈ)?
+ ## Ends in இ, ஈ or ஐ -> class 4
+ ## Ends in ஆ, ஏ, ஊ or ஓ -> class 5
+ ## Has exactly two graphemes AND first letter is kuril -> class 6
+ ## Ends in று and penultimate grapheme is not a consonant -> class 7
+ ## Ends in டு and penultimate grapheme is not a consonant -> class 8
+ ## TODO: The above two rules assume the word is at least two graphemes long. Valid assumption?
+ ## All other cases: class 9
+
+ else:
+
+ _, ending_vowel = Ezhuthu.split_combination(word[-1])
+
+ if ending_vowel in (u'இ', u'ஈ', u'ஐ'):
+ return 4
+
+ elif ending_vowel in (u'ஆ', u'ஏ', u'ஊ', u'ஓ'):
+ return 5
+
+ elif len(word)==2 and Ezhuthu.is_kuril(Chol[0]):
+ return 6
+
+ elif word[-1]==u'று' and not Ezhuthu.is_consonant(word[-2]):
+ return 7
+
+ elif word[-1]==u'டு' and not Ezhuthu.is_consonant(word[-2]):
+ return 8
+
+ else:
+ return 9
+
+ def add_suffix(suffix = u''):
+ """ docstring """
+
+
+ #TODO: Implement method
+
+
+
+ @staticmethod
+ def get_plural(word = u''):
+ """ docstring """
+
+
+ #TODO: Implement method
+
+
+
+
+ @staticmethod
+ def get_root(word):
+ """ docstring """
+
+
+ #TODO: Implement method
+
diff --git a/amuthaa/Verb.py b/amuthaa/Verb.py
new file mode 100644
index 0000000..8f354c6
--- /dev/null
+++ b/amuthaa/Verb.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+from Ezhuthu import Ezhuthu
+from Chol import Chol
+
+
+class Verb(Chol):
+
+ @staticmethod
+ def validate_class(noun_class = 0):
+ """ docstring """
+
+ #TODO: implement method
+
+
+
+ @staticmethod
+ def conjugate(verb=u'', verbclass=0, tense='PRESENT'):
+ """ docstring """
+
+ #TODO: Implement method
diff --git a/amuthaa/src/Chol.py b/amuthaa/src/Chol.py
new file mode 100644
index 0000000..9943d33
--- /dev/null
+++ b/amuthaa/src/Chol.py
@@ -0,0 +1,179 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+# import Ezhuthu class
+from Ezhuthu import Ezhuthu
+
+
+# Add skeletal outline for functions. Removed redundant function. Modified import command
+
+class Chol:
+ """
+ Module to handle the processing of Tamil words
+ """
+
+ def __init__(self, text=u''):
+ """ Constructor for Chol class. Takes a unicode string composed of Tamil characters as an optional input. """
+
+ self._text = u''
+ self._syllables = []
+ self._letters = []
+
+ # if text is entered, call the text property's setter (which generates the syllables and letters lists)
+ if text: self.text(text)
+
+
+ def __getitem__(self,index):
+ """ Read the letter at the given position in the letters list """
+
+ self._letters[index]
+
+
+ def __setitem__(self, index, value):
+ """ Modify a member at the given position in the letters list """
+
+ self._letters[index] = value
+
+
+ @property
+ def text(self):
+ return self._text
+
+ @text.setter
+ def text(self, text):
+
+ # if valid text is entered, calculate syllables and letters
+
+ if self.validate():
+ self.text = text
+
+ self._letters = self.split_letters(text)
+ #TODO: calculate syllables
+
+ # if invalid text is entered, initialize to empty string
+ else:
+ self.text = u''
+
+
+ @property
+ def syllables(self):
+ return self._syllables
+
+ @property
+ def letters(self):
+ return self._letters
+
+
+ def validate(self):
+ """ Checks whether the given word is valid """
+
+ # simple test: every element of the string has to be a valid Tamil character
+ for codepoint in self.text:
+ Ezhuthu.validate_letter(codepoint)
+
+
+ #TODO: implement method this more thoroughly
+ #TODO: check for pulli or combination_ending at the beginning of a word
+
+ return True
+
+
+ @staticmethod
+ def split_letters(word=u''):
+ """ Returns the graphemes (i.e. the Tamil characters) in a given word as a list """
+
+ # ensure that the word is a valid word
+ Chol.validate_word(word)
+
+ # list (which will be returned to user)
+ letters = []
+
+ # a tuple of all combination endings and of all அ combinations
+ combination_endings = Ezhuthu.get_combination_endings()
+ a_combinations = Ezhuthu.get_combination_column(u'அ').values()
+
+ # loop through
+ for codepoint in word:
+
+ # if codepoint is an அ combination, a vowel, aytham or a space, add it to the list
+ if codepoint in a_combinations or Ezhuthu.is_whitespace(codepoint) or Ezhuthu.is_vowel(codepoint) or Ezhuthu.is_aytham(codepoint):
+ letters.append(codepoint)
+
+ # if codepoint is a combination ending or a pulli ('்'), add it to the end of the previously-added codepoint
+ elif codepoint in combination_endings or codepoint==Ezhuthu.get_pulli():
+
+ # ensure that at least one character already exists
+ if len(letters) > 0:
+ letters[-1] = letters[-1] + codepoint
+
+ # otherwise raise an Error. validate_word() should catch this, however
+ else:
+ raise ValueError("Unknown error: The combination ending %s cannot be the first character of a word" %(codepoint))
+
+ # if codepoint was neither a vowel, aytham, a pulli or a combination ending, an unexpected error has occurred
+ else:
+ raise ValueError("Unknown error: The codepoint \'%s\' in word %s is neither a vowel, consonant, combination or aytham" %(codepoint, word))
+
+
+ #TODO: Write extensive test cases for this
+
+ return letters
+
+ @staticmethod
+ def print_letters(word = u'', delimiter="-"):
+ """ Prints all the graphemes in a word, separated by a delimiter (default: "-") """
+
+ for letter in Chol.get_letters(word):
+ print letter, delimiter,
+
+ # go to new line
+ print
+
+
+ @staticmethod
+ def split_syllables(letters = []):
+ """ Returns the syllables in a given word as a list """
+
+ ## Generic algorithm:
+ ## Each vowel and combination is its own syllable. Consonants and aytham get added to the end of the previous syllable
+
+ # ensure that the word is a valid word
+ Chol.validate_word(''.join(letters))
+
+ # initialize empty list
+ syllables = []
+
+ # loop through letters in the word
+ for letter in letters:
+
+ # if letter is a vowel or combination, it gets its own syllable
+ if Ezhuthu.is_combination(letter) or Ezhuthu.is_vowel(letter):
+ syllables.append(letter)
+
+ # if codepoint is a consonant or aytham, add it to the end of the previously-added codepoint
+ elif Ezhuthu.is_consonant(letter) or Ezhuthu.is_aytham(letter):
+
+ # ensure that at least one character already exists
+ if len(syllables) > 0:
+ syllables[-1] = syllables[-1] + letter
+
+ # if the first letter is a consonant (probably b/c it' s a loanword), add it to the beginning of the string
+ else:
+ syllables.append(letter)
+
+ # if codepoint was neither a vowel, aytham, a pulli or a combination ending, an unexpected error has occurred
+ else:
+ raise Exception("Unknown error: The letter \'%s\' in word %s is neither a vowel, consonant, combination or aytham" %(letter, ''.join(letters)))
+
+
+ #TODO: Write extensive test cases for this
+
+
+
+
+
+
+
+
+
+
diff --git a/amuthaa/src/EzhuthUrai.py b/amuthaa/src/EzhuthUrai.py
new file mode 100644
index 0000000..33d0072
--- /dev/null
+++ b/amuthaa/src/EzhuthUrai.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+class EzhuthUrai:
+ """
+ A module to handle the processing of Tamil passages (from sentences to short stories)
+ """
+
+ #TODO: Implement this
+ pass
\ No newline at end of file
diff --git a/amuthaa/src/Ezhuthu.py b/amuthaa/src/Ezhuthu.py
new file mode 100644
index 0000000..96bcd67
--- /dev/null
+++ b/amuthaa/src/Ezhuthu.py
@@ -0,0 +1,503 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+import unicodedata
+import string
+
+class Ezhuthu:
+ """
+ Module to handle Tamil letter processing
+ """
+
+ ## Declare static variables
+
+
+ VOWEL_TO_ENDING_MAP = {
+ u'அ' : u'', # அ -> '' (empty string)
+ u'ஆ' : u'\u0BBE', # ஆ -> ா
+ u'இ' : u'\u0BBF', # இ -> ி
+ u'ஈ' : u'\u0BC0', # ஈ -> ீ
+ u'உ' : u'\u0BC1', # உ -> ு
+ u'ஊ' : u'\u0BC2', # ஊ -> ூ
+ u'எ': u'\u0BC6', # எ -> ெ
+ u'ஏ' : u'\u0BC7', # ஏ -> ே
+ u'ஐ' : u'\u0BC8', # ஐ -> ை
+ u'ஒ' : u'\u0BCA', # ஒ -> ொ
+ u'ஓ' : u'\u0BCB', # ஓ -> ோ
+ u'ஔ' : u'\u0BCC' # ஔ -> ௌ
+ }
+
+ # create an inverse map as well
+ ENDING_TO_VOWEL_MAP = dict((ending, vowel) for vowel, ending in VOWEL_TO_ENDING_MAP.iteritems() if ending!=u'')
+
+ # create vowel ending list from the dictionary's keys and values
+ COMBINATION_ENDINGS = ENDING_TO_VOWEL_MAP.keys()
+
+ PULLI = u'்'
+
+ AYTHAM = u'ஃ'
+
+ CONSONANTS = {
+ 'VALLINAM' : (u'க்', u'ச்', u'ட்', u'த்', u'ப்', u'ற்'),
+ 'MELLINAM' : (u'ங்', u'ஞ்', u'ண்', u'ந்', u'ம்', u'ன்'),
+ 'IDAIYINAM' : (u'ய்',u'ர்', u'ல்', u'வ்', u'ழ்', u'ள்'),
+
+ ## Removing support for 'க்ஷ்' and 'ஶ்' temporarily
+ #TODO: Add support for 'க்ஷ்', 'ஶ்'
+ #'GRANTHA' : (u'ஶ்', u'ஜ்', u'ஷ்', u'ஸ்', u'ஹ்', u'க்ஷ்')
+ 'GRANTHA' : (u'ஜ்', u'ஷ்', u'ஸ்', u'ஹ்')
+ }
+
+ VOWELS = {
+ 'KURIL' : (u'அ', u'இ', u'உ', u'எ', u'ஒ'),
+ 'NEDIL' : (u'ஆ', u'ஈ', u'ஊ', u'ஏ', u'ஐ', u'ஓ', u'ஔ')
+ }
+
+
+
+
+ @staticmethod
+ def get_script_name(letter = u''):
+ """ Returns the name of the script that the unicode character is encoded in """
+
+ return unicodedata.name(letter[0]).split()[0]
+
+
+ @staticmethod
+ def validate_letter(letter = u''):
+ """
+ Ensures that letter is of type unicode, is not equal to an empty string and is a Tamil letter (according to the Unicode consortium).
+ If one of these conditions is not met, an Exception is raised. If all of them are met, True is returned
+ """
+
+ # Check for non-unicode objects
+ if not isinstance(letter, unicode):
+ raise TypeError("Must be unicode string. Value \'%s\' of type %s received" %(letter, type(letter)))
+
+ # Check for empty strings
+ if len(letter)==0:
+ raise ValueError("Expected a Unicode character. Empty string received.")
+
+ # Check for non-Tamil, non-whitespace characters
+ script_language = Ezhuthu.get_script_name(letter).title()
+ if script_language != 'Tamil' and not Ezhuthu.is_whitespace(letter):
+ raise ValueError("Expected a Tamil character or whitespace. \'%s\' is from the %s script" %(letter, script_language))
+
+ # TODO: for more than one character
+
+ # TODO: Allow punctuation and digits
+
+ # If we've gotten this far, everything seems to be alright
+ return True
+
+
+
+ ## Getter methods for aytham, vowels, consonants and combinations
+
+ @staticmethod
+ def get_aytham():
+ """ Returns a single unicode letter - aytham """
+
+ return Ezhuthu.AYTHAM
+
+ @staticmethod
+ def get_vowels():
+ """ Returns a tuple of all the vowels """
+
+ # get keys from VOWEL_TO_ENDING_MAP and convert to tuple
+ return tuple(Ezhuthu.VOWEL_TO_ENDING_MAP.keys())
+
+ @staticmethod
+ def get_consonants():
+ """ Returns a tuple of all the consonants """
+
+ # merge all sub-iterables in CONSONANTS into one tuple
+ return tuple(consonant for consonant_group in Ezhuthu.CONSONANTS.values() for consonant in consonant_group)
+
+ @staticmethod
+ def get_letter_type(letter = u''):
+ """ Returns the letter type: Vowel, Consonant or Combination """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ if Ezhuthu.is_vowel(letter):
+ return 'VOWEL'
+ elif Ezhuthu.is_consonant(letter):
+ return 'CONSONANT'
+ elif Ezhuthu.is_combination(letter):
+ return 'COMBINATION'
+ elif Ezhuthu.is_aytham(letter):
+ return 'AYTHAM'
+ else:
+ raise Exception("Unknown error. Letter \'%s\' is coming up as neither a vowel, consonant or combination" %letter)
+
+ @staticmethod
+ def is_aytham(letter = u''):
+ """
+ Checks whether the given letter is the Aytha Ezhuthu (ஃ)
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ return letter == Ezhuthu.get_aytham()
+
+
+ ## Boolean methods to check whether a given letter is aytham, a vowel, a consonant or a combination
+
+ @staticmethod
+ def is_vowel(letter = u''):
+ """
+ a character is a vowel if it has a length of one and if its value is between
+ 2949 (அ) and 2964 (ஔ)
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ return len(letter)==1 and (ord(u'அ') <= ord(letter) <= ord(u'ஔ'))
+
+ @staticmethod
+ def is_consonant(letter = u''):
+ """
+ a character is a consonant if it has a length of two and its
+ second (and last) character is the pulli (்)
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ return (len(letter)==2 and (letter[1] == u'்')) and (ord(u'க') <= ord(letter[0]) <= ord(u'ஹ'))
+
+ @staticmethod
+ def is_combination(letter = u''):
+ """
+ Check whether a letter is a combination or not
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # a letter is a combination if it has exactly two characters, the first of which is in the 'அ' column,
+ # and the second of which is a combination ending ( ே, ி, etc.)
+ return (ord(u'க') <= ord(letter[0]) <= ord(u'ஹ')) and (len(letter)==1 or (len(letter)==2 and letter[1] in Ezhuthu.COMBINATION_ENDINGS))
+
+
+ @staticmethod
+ def is_kuril(letter = u''):
+ """
+ A character is 'kuril' if it is a vowel or combination with a short sound.
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # retrieve the vowel component of the letter and check if it's a kuril sound
+ _, vowel = Ezhuthu.split_combination(letter)
+ return vowel in Ezhuthu.VOWELS['KURIL']
+
+
+ @staticmethod
+ def is_nedil(letter = u''):
+ """ a character is 'nedil' if it is a vowel or combination with a long sound.
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # retrieve the vowel component of the letter and check if it's a nedil sound
+ _, vowel = Ezhuthu.split_combination(letter)
+ return vowel in Ezhuthu.VOWELS['NEDIL']
+
+
+ @staticmethod
+ def get_vowel_type(letter = u''):
+ """
+ Returns the vowel type (i.e. 'KURIL' or 'NEDIL')
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # ensure that the letter is a vowel or combination
+ if not Ezhuthu.is_vowel(letter) and not Ezhuthu.is_combination(letter):
+ raise ValueError("Vowel or combination expected, but the letter \'%s\' is a %s" %(letter, Ezhuthu.get_letter_type(letter).title()))
+
+ # if letter is a combination, split out the vowel part
+ _, vowel = Ezhuthu.split_combination(letter)
+
+ # retrieve and return the vowel type
+ for vowel_type in Ezhuthu.VOWELS:
+ if vowel in Ezhuthu.VOWELS[vowel_type]:
+ return vowel_type
+
+ # if we got this far, an unknown error occurred
+ raise Exception("Unknown error. Letter \'%s\' is coming up as neither kuril nor nedil" %letter)
+
+
+ @staticmethod
+ def is_vallinam(letter = u''):
+ """
+ Checks whether or not a given letter is vallinam
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if not consonant, it is not a vallinam consonant
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a hard consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['VALLINAM']
+
+ @staticmethod
+ def is_mellinam(letter = u''):
+ """
+ Checks whether or not a given letter is mellinam
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a soft consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['MELLINAM']
+
+ @staticmethod
+ def is_idaiyinam(letter = u''):
+ """
+ Checks whether or not a given letter is idaiyinam
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if not consonant, it is not an idaiyinam consonant
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a medium consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['IDAIYINAM']
+
+ @staticmethod
+ def is_grantha(letter = u''):
+ """
+ Checks whether or not a given letter is grantha
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if not a consonant, it is not a grantha consonant
+ if not Ezhuthu.is_consonant(letter):
+ return False
+
+ # retrieve the consonant component of the letter and check if it's a grantha consonant
+ consonant, _ = Ezhuthu.split_combination(letter)
+ return consonant in Ezhuthu.CONSONANTS['GRANTHA']
+
+
+ @staticmethod
+ def is_whitespace(letter = u''):
+ """ Checks whether or not a given letter is whitespace (e.g. a space, tab, etc.) """
+
+ #TODO: write test cases for this
+ return len(letter)>0 and (letter.isspace() or unicodedata.category(letter)[0].upper()==u'Z')
+
+
+ @staticmethod
+ def is_punctuation(letter = u''):
+ """ Checks whether or not a given letter is punctuation """
+
+ #TODO: write test cases for this
+ #TODO: string.punctuation contains some symbols, so the condition below will return false positives
+ return letter in string.punctuation or unicodedata.category(letter)[0].upper() in ('P')
+
+
+ @staticmethod
+ def is_digit(letter = u''):
+ """ Checks whether or not a given letter is a digit """
+
+ #TODO: write test cases for this
+ return letter.isnumeric() or letter.isdecimal() or unicodedata.category(letter[0]).upper() in ('N')
+
+
+ @staticmethod
+ def is_symbol(letter = u''):
+ """ Checks whether or not a given letter is a symbol """
+
+ #TODO: write test cases for this
+ #TODO: See if the python string function has anything for handling this
+ return unicodedata.category(letter)[0].upper() in ('S')
+
+
+ @staticmethod
+ def get_consonant_type(letter = u''):
+ """
+ Returns the consonant type (i.e. 'VALLINAM', 'MELLINAM', 'IDAIYINAM' or 'GRANTHA')
+ """
+
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # ensure that the letter is a vowel
+ if not Ezhuthu.is_consonant(letter):
+ raise ValueError("Consonant expected, but the letter \'%s\' is a %s" %(letter, Ezhuthu.get_letter_type(letter).title()))
+
+ # retrieve and return the vowel type
+ for consonant_type in Ezhuthu.CONSONANTS:
+ if letter in Ezhuthu.CONSONANTS[consonant_type]:
+ return consonant_type
+
+ # if we got this far, an unknown error occurred
+ raise Exception("Unknown error. Letter \'%s\' is coming up as neither kuril nor nedil" %letter)
+
+
+ @staticmethod
+ def get_combination(consonant=u'', vowel=u''):
+ """
+ Returns a combination given a vowel and a consonant
+ """
+
+ # ensure that the consonant and vowel are valid single Tamil unicode graphemes
+ Ezhuthu.validate_letter(consonant)
+ Ezhuthu.validate_letter(vowel)
+
+ if not Ezhuthu.is_consonant(consonant):
+ raise ValueError("Consonant expected. \'%s\' is not a consonant" %consonant)
+
+ if not Ezhuthu.is_vowel(vowel):
+ raise ValueError("Vowel expected. \'%s\' is not a vowel" %(vowel))
+
+ # store combination initially as an array
+ combination = []
+
+ # combination = first part of consonant (i.e. the அ-column, plus the extension)
+ combination.append(consonant[0])
+ combination.append(Ezhuthu.VOWEL_TO_ENDING_MAP[vowel])
+
+ return ''.join(combination)
+
+
+
+ @staticmethod
+ def split_combination(letter=u''):
+ """
+ Returns a consonant, vowel tuple when given a combination
+ """
+ # ensure that the letter is a valid single Tamil unicode grapheme
+ Ezhuthu.validate_letter(letter)
+
+ # if consonant, no vowel in the tuple
+ if Ezhuthu.is_consonant(letter):
+ return letter, u''
+
+ # if vowel, no consonant in the tuple
+ elif Ezhuthu.is_vowel(letter):
+ return u'', letter
+
+ # if combination ending with -அ, return அ
+ elif len(letter)==1 and (ord(u'க') <= ord(letter) <= ord(u'ஹ')):
+ return letter+Ezhuthu.get_pulli(), u'அ'
+
+ # if non-அ combination, separate the vowel from the extension and return it
+ elif len(letter)==2 and Ezhuthu.is_combination(letter):
+
+ # the consonant is the first part, plus the pulli
+ consonant = []
+ consonant.append(letter[0])
+ consonant.append(Ezhuthu.PULLI)
+ consonant = ''.join(consonant) # convert to string
+
+ # get vowel using the extension
+ vowel = Ezhuthu.ENDING_TO_VOWEL_MAP[letter[1]]
+
+ # return the (consonant, vowel) tuple
+ return consonant, vowel
+
+ # if aytham, return empty unicode strings for both vowel and consonant
+ elif Ezhuthu.is_aytham(letter):
+ return u'', u''
+
+ else:
+ raise Exception("An unknown exception occurred for letter %s." %letter)
+
+
+ @staticmethod
+ def get_combination_column(vowel = u''):
+ """
+ Returns a dictionary of combinations for a particular vowel, mapped by consonant
+ """
+ ## Ensure that letter is a valid Tamil unicode character and a vowel
+ Ezhuthu.validate_letter(vowel)
+
+ if not Ezhuthu.is_vowel(vowel):
+ raise ValueError("Vowel required. \'%s\' is a %s" %(vowel, Ezhuthu.get_letter_type(vowel).title()))
+
+
+ # Declare empty dictionary
+ combination_col = {}
+
+ # For each vowel, determine the respective consonant-vowel combination and add it to the dictionary object
+ for consonant in Ezhuthu.get_consonants():
+
+ # The first letter of the combination is the அ combination for the consonant
+ # The second is an extension, which is obtained from the VOWEL_TO_ENDING_MAP
+ combination = consonant[0]+Ezhuthu.VOWEL_TO_ENDING_MAP[vowel]
+ combination_col.update({consonant : combination})
+
+
+ return combination_col
+
+
+ @staticmethod
+ def get_combination_row(consonant = u''):
+ """
+ Returns a dictionary of combinations for a particular consonant, mapped by vowel
+ """
+
+ ## Ensure that letter is a valid Tamil unicode character and a consonant
+ Ezhuthu.validate_letter(consonant)
+
+ if not Ezhuthu.is_consonant(consonant):
+ raise ValueError("Consonant required. \'%s\' is a %s" %(consonant, Ezhuthu.get_letter_type(consonant).title()))
+
+
+ # Declare empty dictionary
+ combination_row = {}
+
+ # For each vowel, determine the respective consonant-vowel combination and add it to the dictionary object
+ for vowel in Ezhuthu.get_vowels():
+
+ # The first letter of the combination is the அ combination for the consonant
+ # The second is an extension, which is obtained from the VOWEL_TO_ENDING_MAP
+ combination = consonant[0]+Ezhuthu.VOWEL_TO_ENDING_MAP[vowel]
+ combination_row.update({vowel : combination})
+
+
+ return combination_row
+
+ @staticmethod
+ def get_combination_endings():
+ """ Returns a tuple of vowel combination endings (ி ,ீ , ே, etc.) """
+
+ #TODO: create a test case for this
+
+ # get the list of combination endings, remove the empty unicode string and convert to a tuple
+ return tuple(Ezhuthu.COMBINATION_ENDINGS)
+
+
+ @staticmethod
+ def get_pulli():
+ """ Returns the pulli codepoint ('்') """
+
+ #TODO: Create a test case for this
+
+ return Ezhuthu.PULLI
+
+
+
diff --git a/amuthaa/src/Noun.py b/amuthaa/src/Noun.py
new file mode 100644
index 0000000..38ab2c8
--- /dev/null
+++ b/amuthaa/src/Noun.py
@@ -0,0 +1,135 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+from Ezhuthu import Ezhuthu
+from Chol import Chol
+
+# Suffix dictionary: maps suffix to வேற்றுமை type
+SUFFIX = {
+ u'ஐ' : 1,
+ u'ஆல்' : 2,
+ u'ஓடு' : 2,
+ u'உடன்' : 2,
+ u'கு' : 4,
+ u'இல்' : 5,
+ u'இன்' : 5,
+ u'ஐ விட' : 5,
+ # u' இனின்று' : 5, - commented this out. Never heard of it
+ u'இலிருந்து' : 5,
+ u'அது' : 6,
+ u'ஆது' : 6,
+ u'அ' : 6,
+ u'உடைய' : 6,
+ u'இனுடைய' : 6,
+ u'இல்' : 7,
+ u'இடத்தில்' : 7,
+ u'மேல்' : 7,
+ u'இன்மேல்' : 7,
+ u'கீழ்' : 7,
+ u'இன்கீழ்' : 7,
+ u'உள்' : 7,
+ u'கு உள்' : 7,
+ u'உம்' : 0,
+ u'ஆ' : 0,
+ u'ஏ' : 0,
+ u'ஓ' : 0
+ }
+
+
+class Noun(Chol):
+
+
+
+ def __init__(self, text=u''):
+ self._noun_class = None
+
+
+ @staticmethod
+ def validate_class(noun_class = 0):
+ """ docstring """
+
+
+ #TODO: implement method
+
+ @staticmethod
+ def get_class(word = u''):
+ """ Returns the noun class for a given word """
+
+ ### See flowchart in docs/material/sendhil/noun_classes.png for more details
+
+ word = Chol(word)
+
+ ## For noun classes ending in a consonant:
+ ## Ending in ம் -> class 1
+ ## Ending in ல், ன், ய், ள், ண் AND has exactly two graphemes AND first letter is kuril: class 2
+ ## All other consonant-ending nouns -> class 3
+
+ if Ezhuthu.is_consonant(word[-1]):
+
+ if word[-1] == u'ம்':
+ return 1
+
+ elif word[-1] in (u'ல்', u'ன்', u'ய்', u'ள்', u'ண்') and len(word)==2 and Ezhuthu.is_kuril(word[0]):
+ return 2
+
+ else:
+ return 3
+
+ ## For noun classes not ending in a combination:
+ ## TODO: What if a noun ends in Aytham?
+ ## TODO: Has this been tested on one-letter long all-vowel nouns (e.g. ஈ)?
+ ## Ends in இ, ஈ or ஐ -> class 4
+ ## Ends in ஆ, ஏ, ஊ or ஓ -> class 5
+ ## Has exactly two graphemes AND first letter is kuril -> class 6
+ ## Ends in று and penultimate grapheme is not a consonant -> class 7
+ ## Ends in டு and penultimate grapheme is not a consonant -> class 8
+ ## TODO: The above two rules assume the word is at least two graphemes long. Valid assumption?
+ ## All other cases: class 9
+
+ else:
+
+ _, ending_vowel = Ezhuthu.split_combination(word[-1])
+
+ if ending_vowel in (u'இ', u'ஈ', u'ஐ'):
+ return 4
+
+ elif ending_vowel in (u'ஆ', u'ஏ', u'ஊ', u'ஓ'):
+ return 5
+
+ elif len(word)==2 and Ezhuthu.is_kuril(Chol[0]):
+ return 6
+
+ elif word[-1]==u'று' and not Ezhuthu.is_consonant(word[-2]):
+ return 7
+
+ elif word[-1]==u'டு' and not Ezhuthu.is_consonant(word[-2]):
+ return 8
+
+ else:
+ return 9
+
+ def add_suffix(suffix = u''):
+ """ docstring """
+
+
+ #TODO: Implement method
+
+
+
+ @staticmethod
+ def get_plural(word = u''):
+ """ docstring """
+
+
+ #TODO: Implement method
+
+
+
+
+ @staticmethod
+ def get_root(word):
+ """ docstring """
+
+
+ #TODO: Implement method
+
diff --git a/amuthaa/src/Verb.py b/amuthaa/src/Verb.py
new file mode 100644
index 0000000..8f354c6
--- /dev/null
+++ b/amuthaa/src/Verb.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+from Ezhuthu import Ezhuthu
+from Chol import Chol
+
+
+class Verb(Chol):
+
+ @staticmethod
+ def validate_class(noun_class = 0):
+ """ docstring """
+
+ #TODO: implement method
+
+
+
+ @staticmethod
+ def conjugate(verb=u'', verbclass=0, tense='PRESENT'):
+ """ docstring """
+
+ #TODO: Implement method
diff --git a/amuthaa/src/__init__.py b/amuthaa/src/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/amuthaa/src/__init__.py
@@ -0,0 +1 @@
+
diff --git a/amuthaa/tests/__init__.py b/amuthaa/tests/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/amuthaa/tests/__init__.py
@@ -0,0 +1 @@
+
diff --git a/amuthaa/tests/unittest_Chol.py b/amuthaa/tests/unittest_Chol.py
new file mode 100644
index 0000000..53544e9
--- /dev/null
+++ b/amuthaa/tests/unittest_Chol.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+
+import unittest
+
+# import Ezhuthu class
+try:
+ from learntamil.apps.amuthaa.lib.Ezhuthu import Ezhuthu
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ from Ezhuthu import Ezhuthu
+
+# import Chol class
+try:
+ from learntamil.apps.amuthaa.lib.Chol import Chol
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ from Chol import Chol
+
+class CholTest(unittest.TestCase):
+ """
+ A test class for the Chol module
+ """
+
+ def setUp(self):
+ #TODO: add setup
+ pass
+
+ def tearDown(self):
+ #TODO: Add tear-down
+ pass
+
+ def testSomething(self):
+ """docstring"""
+
+ #TODO: implement this
+
+
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(CholTest))
+ return suite
+
+def main():
+ runner = unittest.TextTestResult()
+ test_suite = suite()
+ runner.run(test_suite)
+
+
+if __name__ == '__main__':
+ main()
\ No newline at end of file
diff --git a/amuthaa/tests/unittest_EzhuthUrai.py b/amuthaa/tests/unittest_EzhuthUrai.py
new file mode 100644
index 0000000..d102e60
--- /dev/null
+++ b/amuthaa/tests/unittest_EzhuthUrai.py
@@ -0,0 +1,102 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+
+import unittest
+
+# import Ezhuthu class
+try:
+ from learntamil.apps.amuthaa.lib.Ezhuthu import Ezhuthu
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ from Ezhuthu import Ezhuthu
+
+# import Chol class
+try:
+ from learntamil.apps.amuthaa.lib.Chol import Chol
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ from Chol import Chol
+
+# import EzhuthUrai class
+try:
+ from learntamil.apps.amuthaa.lib.EzhuthUrai import EzhuthUrai
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ from EzhuthUrai import EzhuthUrai
+
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+
+import unittest
+
+# import Ezhuthu class
+try:
+ import learntamil.apps.amuthaa.lib.Ezhuthu
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ import Ezhuthu
+
+# import Chol class
+try:
+ import learntamil.apps.amuthaa.lib.Chol
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ import Chol
+
+
+
+class EzhuthUraiTest(unittest.TestCase):
+ """
+ A test class for the EzhuthUrai module
+ """
+
+ def setUp(self):
+ #TODO: add setup
+ pass
+
+ def tearDown(self):
+ #TODO: Add tear-down
+ pass
+
+ def testSomething(self):
+ """docstring"""
+
+ #TODO: implement this
+
+
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(EzhuthUraiTest))
+ return suite
+
+def main():
+ runner = unittest.TextTestResult()
+ test_suite = suite()
+ runner.run(test_suite)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/amuthaa/tests/unittest_Ezhuthu.py b/amuthaa/tests/unittest_Ezhuthu.py
new file mode 100644
index 0000000..a633564
--- /dev/null
+++ b/amuthaa/tests/unittest_Ezhuthu.py
@@ -0,0 +1,1459 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+
+import unittest
+import logging
+
+# import Ezhuthu class
+try:
+ from learntamil.apps.amuthaa.lib.Ezhuthu import Ezhuthu
+except ImportError:
+ import sys
+ from os.path import join, abspath, dirname
+ parentpath = abspath(join(dirname(__file__), '..'))
+ srcpath = join(parentpath, 'lib')
+ sys.path.append(srcpath)
+ from Ezhuthu import Ezhuthu
+
+logging.basicConfig(level=logging.DEBUG)
+
+# a tuple dictionary that matches a consonant, vowel tuple to its combination
+COMBINATIONS = {
+ (u'க்', u'அ') : u'க', (u'க்', u'ஆ') : u'கா', (u'க்', u'இ') : u'கி',
+ (u'க்', u'ஈ') : u'கீ', (u'க்', u'உ') : u'கு', (u'க்', u'ஊ') : u'கூ',
+ (u'க்', u'எ') : u'கெ', (u'க்', u'ஏ') : u'கே', (u'க்', u'ஐ') : u'கை',
+ (u'க்', u'ஒ') : u'கொ', (u'க்', u'ஓ') : u'கோ', (u'க்', u'ஔ') : u'கௌ',
+
+ (u'ங்', u'அ') : u'ங', (u'ங்', u'ஆ') : u'ஙா', (u'ங்', u'இ') : u'ஙி',
+ (u'ங்', u'ஈ') : u'ஙீ', (u'ங்', u'உ') : u'ஙு', (u'ங்', u'ஊ') : u'ஙூ',
+ (u'ங்', u'எ') : u'ஙெ', (u'ங்', u'ஏ') : u'ஙே', (u'ங்', u'ஐ') : u'ஙை',
+ (u'ங்', u'ஒ') : u'ஙொ', (u'ங்', u'ஓ') : u'ஙோ', (u'ங்', u'ஔ') : u'ஙௌ',
+
+ (u'ச்', u'அ') : u'ச', (u'ச்', u'ஆ') : u'சா', (u'ச்', u'இ') : u'சி',
+ (u'ச்', u'ஈ') : u'சீ', (u'ச்', u'உ') : u'சு', (u'ச்', u'ஊ') : u'சூ',
+ (u'ச்', u'எ') : u'செ', (u'ச்', u'ஏ') : u'சே', (u'ச்', u'ஐ') : u'சை',
+ (u'ச்', u'ஒ') : u'சொ', (u'ச்', u'ஓ') : u'சோ', (u'ச்', u'ஔ') : u'சௌ',
+
+ (u'ஞ்', u'அ') : u'ஞ', (u'ஞ்', u'ஆ') : u'ஞா', (u'ஞ்', u'இ') : u'ஞி',
+ (u'ஞ்', u'ஈ') : u'ஞீ', (u'ஞ்', u'உ') : u'ஞு', (u'ஞ்', u'ஊ') : u'ஞூ',
+ (u'ஞ்', u'எ') : u'ஞெ', (u'ஞ்', u'ஏ') : u'ஞே', (u'ஞ்', u'ஐ') : u'ஞை',
+ (u'ஞ்', u'ஒ') : u'ஞொ', (u'ஞ்', u'ஓ') : u'ஞோ', (u'ஞ்', u'ஔ') : u'ஞௌ',
+
+ (u'ட்', u'அ') : u'ட', (u'ட்', u'ஆ') : u'டா', (u'ட்', u'இ') : u'டி',
+ (u'ட்', u'ஈ') : u'டீ', (u'ட்', u'உ') : u'டு', (u'ட்', u'ஊ') : u'டூ',
+ (u'ட்', u'எ') : u'டெ', (u'ட்', u'ஏ') : u'டே', (u'ட்', u'ஐ') : u'டை',
+ (u'ட்', u'ஒ') : u'டொ', (u'ட்', u'ஓ') : u'டோ', (u'ட்', u'ஔ') : u'டௌ',
+
+ (u'ண்', u'அ') : u'ண', (u'ண்', u'ஆ') : u'ணா', (u'ண்', u'இ') : u'ணி',
+ (u'ண்', u'ஈ') : u'ணீ', (u'ண்', u'உ') : u'ணு', (u'ண்', u'ஊ') : u'ணூ',
+ (u'ண்', u'எ') : u'ணெ', (u'ண்', u'ஏ') : u'ணே', (u'ண்', u'ஐ') : u'ணை',
+ (u'ண்', u'ஒ') : u'ணொ', (u'ண்', u'ஓ') : u'ணோ', (u'ண்', u'ஔ') : u'ணௌ',
+
+ (u'த்', u'அ') : u'த', (u'த்', u'ஆ') : u'தா', (u'த்', u'இ') : u'தி',
+ (u'த்', u'ஈ') : u'தீ', (u'த்', u'உ') : u'து', (u'த்', u'ஊ') : u'தூ',
+ (u'த்', u'எ') : u'தெ', (u'த்', u'ஏ') : u'தே', (u'த்', u'ஐ') : u'தை',
+ (u'த்', u'ஒ') : u'தொ', (u'த்', u'ஓ') : u'தோ', (u'த்', u'ஔ') : u'தௌ',
+
+ (u'ந்', u'அ') : u'ந', (u'ந்', u'ஆ') : u'நா', (u'ந்', u'இ') : u'நி',
+ (u'ந்', u'ஈ') : u'நீ', (u'ந்', u'உ') : u'நு', (u'ந்', u'ஊ') : u'நூ',
+ (u'ந்', u'எ') : u'நெ', (u'ந்', u'ஏ') : u'நே', (u'ந்', u'ஐ') : u'நை',
+ (u'ந்', u'ஒ') : u'நொ', (u'ந்', u'ஓ') : u'நோ', (u'ந்', u'ஔ') : u'நௌ',
+
+ (u'ப்', u'அ') : u'ப', (u'ப்', u'ஆ') : u'பா', (u'ப்', u'இ') : u'பி',
+ (u'ப்', u'ஈ') : u'பீ', (u'ப்', u'உ') : u'பு', (u'ப்', u'ஊ') : u'பூ',
+ (u'ப்', u'எ') : u'பெ', (u'ப்', u'ஏ') : u'பே', (u'ப்', u'ஐ') : u'பை',
+ (u'ப்', u'ஒ') : u'பொ', (u'ப்', u'ஓ') : u'போ', (u'ப்', u'ஔ') : u'பௌ',
+
+ (u'ம்', u'அ') : u'ம', (u'ம்', u'ஆ') : u'மா', (u'ம்', u'இ') : u'மி',
+ (u'ம்', u'ஈ') : u'மீ', (u'ம்', u'உ') : u'மு', (u'ம்', u'ஊ') : u'மூ',
+ (u'ம்', u'எ') : u'மெ', (u'ம்', u'ஏ') : u'மே', (u'ம்', u'ஐ') : u'மை',
+ (u'ம்', u'ஒ') : u'மொ', (u'ம்', u'ஓ') : u'மோ', (u'ம்', u'ஔ') : u'மௌ',
+
+ (u'ய்', u'அ') : u'ய', (u'ய்', u'ஆ') : u'யா', (u'ய்', u'இ') : u'யி',
+ (u'ய்', u'ஈ') : u'யீ', (u'ய்', u'உ') : u'யு', (u'ய்', u'ஊ') : u'யூ',
+ (u'ய்', u'எ') : u'யெ', (u'ய்', u'ஏ') : u'யே', (u'ய்', u'ஐ') : u'யை',
+ (u'ய்', u'ஒ') : u'யொ', (u'ய்', u'ஓ') : u'யோ', (u'ய்', u'ஔ') : u'யௌ',
+
+ (u'ர்', u'அ') : u'ர', (u'ர்', u'ஆ') : u'ரா', (u'ர்', u'இ') : u'ரி',
+ (u'ர்', u'ஈ') : u'ரீ', (u'ர்', u'உ') : u'ரு', (u'ர்', u'ஊ') : u'ரூ',
+ (u'ர்', u'எ') : u'ரெ', (u'ர்', u'ஏ') : u'ரே', (u'ர்', u'ஐ') : u'ரை',
+ (u'ர்', u'ஒ') : u'ரொ', (u'ர்', u'ஓ') : u'ரோ', (u'ர்', u'ஔ') : u'ரௌ',
+
+ (u'ல்', u'அ') : u'ல', (u'ல்', u'ஆ') : u'லா', (u'ல்', u'இ') : u'லி',
+ (u'ல்', u'ஈ') : u'லீ', (u'ல்', u'உ') : u'லு', (u'ல்', u'ஊ') : u'லூ',
+ (u'ல்', u'எ') : u'லெ', (u'ல்', u'ஏ') : u'லே', (u'ல்', u'ஐ') : u'லை',
+ (u'ல்', u'ஒ') : u'லொ', (u'ல்', u'ஓ') : u'லோ', (u'ல்', u'ஔ') : u'லௌ',
+
+ (u'வ்', u'அ') : u'வ', (u'வ்', u'ஆ') : u'வா', (u'வ்', u'இ') : u'வி',
+ (u'வ்', u'ஈ') : u'வீ', (u'வ்', u'உ') : u'வு', (u'வ்', u'ஊ') : u'வூ',
+ (u'வ்', u'எ') : u'வெ', (u'வ்', u'ஏ') : u'வே', (u'வ்', u'ஐ') : u'வை',
+ (u'வ்', u'ஒ') : u'வொ', (u'வ்', u'ஓ') : u'வோ', (u'வ்', u'ஔ') : u'வௌ',
+
+ (u'ழ்', u'அ') : u'ழ', (u'ழ்', u'ஆ') : u'ழா', (u'ழ்', u'இ') : u'ழி',
+ (u'ழ்', u'ஈ') : u'ழீ', (u'ழ்', u'உ') : u'ழு', (u'ழ்', u'ஊ') : u'ழூ',
+ (u'ழ்', u'எ') : u'ழெ', (u'ழ்', u'ஏ') : u'ழே', (u'ழ்', u'ஐ') : u'ழை',
+ (u'ழ்', u'ஒ') : u'ழொ', (u'ழ்', u'ஓ') : u'ழோ', (u'ழ்', u'ஔ') : u'ழௌ',
+
+ (u'ள்', u'அ') : u'ள', (u'ள்', u'ஆ') : u'ளா', (u'ள்', u'இ') : u'ளி',
+ (u'ள்', u'ஈ') : u'ளீ', (u'ள்', u'உ') : u'ளு', (u'ள்', u'ஊ') : u'ளூ',
+ (u'ள்', u'எ') : u'ளெ', (u'ள்', u'ஏ') : u'ளே', (u'ள்', u'ஐ') : u'ளை',
+ (u'ள்', u'ஒ') : u'ளொ', (u'ள்', u'ஓ') : u'ளோ', (u'ள்', u'ஔ') : u'ளௌ',
+
+ (u'ற்', u'அ') : u'ற', (u'ற்', u'ஆ') : u'றா', (u'ற்', u'இ') : u'றி',
+ (u'ற்', u'ஈ') : u'றீ', (u'ற்', u'உ') : u'று', (u'ற்', u'ஊ') : u'றூ',
+ (u'ற்', u'எ') : u'றெ', (u'ற்', u'ஏ') : u'றே', (u'ற்', u'ஐ') : u'றை',
+ (u'ற்', u'ஒ') : u'றொ', (u'ற்', u'ஓ') : u'றோ', (u'ற்', u'ஔ') : u'றௌ',
+
+ (u'ன்', u'அ') : u'ன', (u'ன்', u'ஆ') : u'னா', (u'ன்', u'இ') : u'னி',
+ (u'ன்', u'ஈ') : u'னீ', (u'ன்', u'உ') : u'னு', (u'ன்', u'ஊ') : u'னூ',
+ (u'ன்', u'எ') : u'னெ', (u'ன்', u'ஏ') : u'னே', (u'ன்', u'ஐ') : u'னை',
+ (u'ன்', u'ஒ') : u'னொ', (u'ன்', u'ஓ') : u'னோ', (u'ன்', u'ஔ') : u'னௌ',
+
+ (u'ஜ்', u'அ') : u'ஜ', (u'ஜ்', u'ஆ') : u'ஜா', (u'ஜ்', u'இ') : u'ஜி',
+ (u'ஜ்', u'ஈ') : u'ஜீ', (u'ஜ்', u'உ') : u'ஜு', (u'ஜ்', u'ஊ') : u'ஜூ',
+ (u'ஜ்', u'எ') : u'ஜெ', (u'ஜ்', u'ஏ') : u'ஜே', (u'ஜ்', u'ஐ') : u'ஜை',
+ (u'ஜ்', u'ஒ') : u'ஜொ', (u'ஜ்', u'ஓ') : u'ஜோ', (u'ஜ்', u'ஔ') : u'ஜௌ',
+
+ (u'ஷ்', u'அ') : u'ஷ', (u'ஷ்', u'ஆ') : u'ஷா', (u'ஷ்', u'இ') : u'ஷி',
+ (u'ஷ்', u'ஈ') : u'ஷீ', (u'ஷ்', u'உ') : u'ஷு', (u'ஷ்', u'ஊ') : u'ஷூ',
+ (u'ஷ்', u'எ') : u'ஷெ', (u'ஷ்', u'ஏ') : u'ஷே', (u'ஷ்', u'ஐ') : u'ஷை',
+ (u'ஷ்', u'ஒ') : u'ஷொ', (u'ஷ்', u'ஓ') : u'ஷோ', (u'ஷ்', u'ஔ') : u'ஷௌ',
+
+ (u'ஸ்', u'அ') : u'ஸ', (u'ஸ்', u'ஆ') : u'ஸா', (u'ஸ்', u'இ') : u'ஸி',
+ (u'ஸ்', u'ஈ') : u'ஸீ', (u'ஸ்', u'உ') : u'ஸு', (u'ஸ்', u'ஊ') : u'ஸூ',
+ (u'ஸ்', u'எ') : u'ஸெ', (u'ஸ்', u'ஏ') : u'ஸே', (u'ஸ்', u'ஐ') : u'ஸை',
+ (u'ஸ்', u'ஒ') : u'ஸொ', (u'ஸ்', u'ஓ') : u'ஸோ', (u'ஸ்', u'ஔ') : u'ஸௌ',
+
+ (u'ஹ்', u'அ') : u'ஹ', (u'ஹ்', u'ஆ') : u'ஹா', (u'ஹ்', u'இ') : u'ஹி',
+ (u'ஹ்', u'ஈ') : u'ஹீ', (u'ஹ்', u'உ') : u'ஹு', (u'ஹ்', u'ஊ') : u'ஹூ',
+ (u'ஹ்', u'எ') : u'ஹெ', (u'ஹ்', u'ஏ') : u'ஹே', (u'ஹ்', u'ஐ') : u'ஹை',
+ (u'ஹ்', u'ஒ') : u'ஹொ', (u'ஹ்', u'ஓ') : u'ஹோ', (u'ஹ்', u'ஔ') : u'ஹௌ',
+ }
+
+COMBINATIONS_BY_CONSONANT = {
+ u'க்' : { u'அ' : u'க', u'ஆ' : u'கா', u'இ' : u'கி', u'ஈ' : u'கீ',
+ u'உ' : u'கு', u'ஊ' : u'கூ', u'எ' : u'கெ', u'ஏ' : u'கே',
+ u'ஐ' : u'கை', u'ஒ' : u'கொ', u'ஓ' : u'கோ', u'ஔ' : u'கௌ'
+ },
+ u'ங்' : {u'அ' : u'ங', u'ஆ' : u'ஙா', u'இ' : u'ஙி', u'ஈ' :
+ u'ஙீ', u'உ' : u'ஙு', u'ஊ' : u'ஙூ', u'எ' : u'ஙெ', u'ஏ' : u'ஙே',
+ u'ஐ' : u'ஙை', u'ஒ' : u'ஙொ', u'ஓ' : u'ஙோ', u'ஔ' : u'ஙௌ'
+ },
+ u'ச்' : { u'அ' : u'ச', u'ஆ' : u'சா', u'இ' : u'சி', u'ஈ' : u'சீ',
+ u'உ' : u'சு', u'ஊ' : u'சூ', u'எ' : u'செ', u'ஏ' : u'சே',
+ u'ஐ' : u'சை', u'ஒ' : u'சொ', u'ஓ' : u'சோ', u'ஔ' : u'சௌ'
+ },
+ u'ஞ்' : { u'அ' : u'ஞ', u'ஆ' : u'ஞா', u'இ' : u'ஞி', u'ஈ' : u'ஞீ',
+ u'உ' : u'ஞு', u'ஊ' : u'ஞூ', u'எ' : u'ஞெ', u'ஏ' : u'ஞே',
+ u'ஐ' : u'ஞை', u'ஒ' : u'ஞொ', u'ஓ' : u'ஞோ', u'ஔ' : u'ஞௌ'
+ },
+ u'ட்' : { u'அ' : u'ட', u'ஆ' : u'டா', u'இ' : u'டி', u'ஈ' : u'டீ',
+ u'உ' : u'டு', u'ஊ' : u'டூ', u'எ' : u'டெ', u'ஏ' : u'டே',
+ u'ஐ' : u'டை', u'ஒ' : u'டொ', u'ஓ' : u'டோ', u'ஔ' : u'டௌ'
+ },
+ u'ண்' : { u'அ' : u'ண', u'ஆ' : u'ணா', u'இ' : u'ணி', u'ஈ' : u'ணீ',
+ u'உ' : u'ணு', u'ஊ' : u'ணூ', u'எ' : u'ணெ', u'ஏ' : u'ணே',
+ u'ஐ' : u'ணை', u'ஒ' : u'ணொ', u'ஓ' : u'ணோ', u'ஔ' : u'ணௌ'
+ },
+ u'த்' : { u'அ' : u'த', u'ஆ' : u'தா', u'இ' : u'தி', u'ஈ' : u'தீ',
+ u'உ' : u'து', u'ஊ' : u'தூ', u'எ' : u'தெ', u'ஏ' : u'தே',
+ u'ஐ' : u'தை', u'ஒ' : u'தொ', u'ஓ' : u'தோ', u'ஔ' : u'தௌ'
+ },
+ u'ந்' : { u'அ' : u'ந', u'ஆ' : u'நா', u'இ' : u'நி', u'ஈ' : u'நீ',
+ u'உ' : u'நு', u'ஊ' : u'நூ', u'எ' : u'நெ', u'ஏ' : u'நே',
+ u'ஐ' : u'நை', u'ஒ' : u'நொ', u'ஓ' : u'நோ', u'ஔ' : u'நௌ'
+ },
+ u'ப்' : { u'அ' : u'ப', u'ஆ' : u'பா', u'இ' : u'பி', u'ஈ' : u'பீ',
+ u'உ' : u'பு', u'ஊ' : u'பூ', u'எ' : u'பெ', u'ஏ' : u'பே',
+ u'ஐ' : u'பை', u'ஒ' : u'பொ', u'ஓ' : u'போ', u'ஔ' : u'பௌ'
+ },
+ u'ம்' : { u'அ' : u'ம', u'ஆ' : u'மா', u'இ' : u'மி', u'ஈ' : u'மீ',
+ u'உ' : u'மு', u'ஊ' : u'மூ', u'எ' : u'மெ', u'ஏ' : u'மே',
+ u'ஐ' : u'மை', u'ஒ' : u'மொ', u'ஓ' : u'மோ', u'ஔ' : u'மௌ'
+ },
+ u'ய்' : { u'அ' : u'ய', u'ஆ' : u'யா', u'இ' : u'யி', u'ஈ' : u'யீ',
+ u'உ' : u'யு', u'ஊ' : u'யூ', u'எ' : u'யெ', u'ஏ' : u'யே',
+ u'ஐ' : u'யை', u'ஒ' : u'யொ', u'ஓ' : u'யோ', u'ஔ' : u'யௌ'
+ },
+ u'ர்' : { u'அ' : u'ர', u'ஆ' : u'ரா', u'இ' : u'ரி', u'ஈ' : u'ரீ',
+ u'உ' : u'ரு', u'ஊ' : u'ரூ', u'எ' : u'ரெ', u'ஏ' : u'ரே',
+ u'ஐ' : u'ரை', u'ஒ' : u'ரொ', u'ஓ' : u'ரோ', u'ஔ' : u'ரௌ'
+ },
+ u'ல்' : { u'அ' : u'ல', u'ஆ' : u'லா', u'இ' : u'லி', u'ஈ' : u'லீ',
+ u'உ' : u'லு', u'ஊ' : u'லூ', u'எ' : u'லெ', u'ஏ' : u'லே',
+ u'ஐ' : u'லை', u'ஒ' : u'லொ', u'ஓ' : u'லோ', u'ஔ' : u'லௌ'
+ },
+ u'வ்' : { u'அ' : u'வ', u'ஆ' : u'வா', u'இ' : u'வி', u'ஈ' : u'வீ',
+ u'உ' : u'வு', u'ஊ' : u'வூ', u'எ' : u'வெ', u'ஏ' : u'வே',
+ u'ஐ' : u'வை', u'ஒ' : u'வொ', u'ஓ' : u'வோ', u'ஔ' : u'வௌ'
+ },
+ u'ழ்' : { u'அ' : u'ழ', u'ஆ' : u'ழா', u'இ' : u'ழி', u'ஈ' : u'ழீ',
+ u'உ' : u'ழு', u'ஊ' : u'ழூ', u'எ' : u'ழெ', u'ஏ' : u'ழே',
+ u'ஐ' : u'ழை', u'ஒ' : u'ழொ', u'ஓ' : u'ழோ', u'ஔ' : u'ழௌ'
+ },
+ u'ள்' : { u'அ' : u'ள', u'ஆ' : u'ளா', u'இ' : u'ளி', u'ஈ' : u'ளீ',
+ u'உ' : u'ளு', u'ஊ' : u'ளூ', u'எ' : u'ளெ', u'ஏ' : u'ளே',
+ u'ஐ' : u'ளை', u'ஒ' : u'ளொ', u'ஓ' : u'ளோ', u'ஔ' : u'ளௌ'
+ },
+ u'ற்' : { u'அ' : u'ற', u'ஆ' : u'றா', u'இ' : u'றி', u'ஈ' : u'றீ',
+ u'உ' : u'று', u'ஊ' : u'றூ', u'எ' : u'றெ', u'ஏ' : u'றே',
+ u'ஐ' : u'றை', u'ஒ' : u'றொ', u'ஓ' : u'றோ', u'ஔ' : u'றௌ'
+ },
+ u'ன்' : { u'அ' : u'ன', u'ஆ' : u'னா', u'இ' : u'னி', u'ஈ' : u'னீ',
+ u'உ' : u'னு', u'ஊ' : u'னூ', u'எ' : u'னெ', u'ஏ' : u'னே',
+ u'ஐ' : u'னை', u'ஒ' : u'னொ', u'ஓ' : u'னோ', u'ஔ' : u'னௌ'
+ },
+ u'ஜ்' : { u'அ' : u'ஜ', u'ஆ' : u'ஜா', u'இ' : u'ஜி', u'ஈ' : u'ஜீ',
+ u'உ' : u'ஜு', u'ஊ' : u'ஜூ', u'எ' : u'ஜெ', u'ஏ' : u'ஜே',
+ u'ஐ' : u'ஜை', u'ஒ' : u'ஜொ', u'ஓ' : u'ஜோ', u'ஔ' : u'ஜௌ'
+ },
+ u'ஸ்' : { u'அ' : u'ஸ', u'ஆ' : u'ஸா', u'இ' : u'ஸி', u'ஈ' : u'ஸீ',
+ u'உ' : u'ஸு', u'ஊ' : u'ஸூ', u'எ' : u'ஸெ', u'ஏ' : u'ஸே',
+ u'ஐ' : u'ஸை', u'ஒ' : u'ஸொ', u'ஓ' : u'ஸோ', u'ஔ' : u'ஸௌ'
+ },
+ u'ஷ்' : { u'அ' : u'ஷ', u'ஆ' : u'ஷா', u'இ' : u'ஷி', u'ஈ' : u'ஷீ',
+ u'உ' : u'ஷு', u'ஊ' : u'ஷூ', u'எ' : u'ஷெ', u'ஏ' : u'ஷே',
+ u'ஐ' : u'ஷை', u'ஒ' : u'ஷொ', u'ஓ' : u'ஷோ', u'ஔ' : u'ஷௌ'
+ },
+ u'ஹ்' : { u'அ' : u'ஹ', u'ஆ' : u'ஹா', u'இ' : u'ஹி', u'ஈ' : u'ஹீ',
+ u'உ' : u'ஹு', u'ஊ' : u'ஹூ', u'எ' : u'ஹெ', u'ஏ' : u'ஹே',
+ u'ஐ' : u'ஹை', u'ஒ' : u'ஹொ', u'ஓ' : u'ஹோ', u'ஔ' : u'ஹௌ'
+ }
+ }
+
+
+COMBINATIONS_BY_VOWEL = {
+ u'அ' : {
+ u'க்' : u'க', u'ங்' : u'ங', u'ச்' : u'ச', u'ஞ்' : u'ஞ', u'ட்' : u'ட', u'ண்' : u'ண',
+ u'த்' : u'த', u'ந்' : u'ந', u'ப்' : u'ப', u'ம்' : u'ம', u'ய்' : u'ய', u'ர்' : u'ர',
+ u'ல்' : u'ல', u'வ்' : u'வ', u'ழ்' : u'ழ', u'ள்' : u'ள', u'ற்' : u'ற', u'ன்' : u'ன',
+ u'ஜ்' : u'ஜ', u'ஷ்' : u'ஷ', u'ஸ்' : u'ஸ', u'ஹ்' : u'ஹ'
+ },
+ u'ஆ' : {
+ u'க்' : u'கா', u'ங்' : u'ஙா', u'ச்' : u'சா', u'ஞ்' : u'ஞா', u'ட்' : u'டா', u'ண்' : u'ணா',
+ u'த்' : u'தா', u'ந்' : u'நா', u'ப்' : u'பா', u'ம்' : u'மா', u'ய்' : u'யா', u'ர்' : u'ரா',
+ u'ல்' : u'லா', u'வ்' : u'வா', u'ழ்' : u'ழா', u'ள்' : u'ளா', u'ற்' : u'றா', u'ன்' : u'னா',
+ u'ஜ்' : u'ஜா', u'ஷ்' : u'ஷா', u'ஸ்' : u'ஸா', u'ஹ்' : u'ஹா'
+ },
+ u'இ' : {
+ u'க்' : u'கி', u'ங்' : u'ஙி', u'ச்' : u'சி', u'ஞ்' : u'ஞி', u'ட்' : u'டி', u'ண்' : u'ணி',
+ u'த்' : u'தி', u'ந்' : u'நி', u'ப்' : u'பி', u'ம்' : u'மி', u'ய்' : u'யி', u'ர்' : u'ரி',
+ u'ல்' : u'லி', u'வ்' : u'வி', u'ழ்' : u'ழி', u'ள்' : u'ளி', u'ற்' : u'றி', u'ன்' : u'னி',
+ u'ஜ்' : u'ஜி', u'ஷ்' : u'ஷி', u'ஸ்' : u'ஸி', u'ஹ்' : u'ஹி'
+ },
+ u'ஈ' : {
+ u'க்' : u'கீ', u'ங்' : u'ஙீ', u'ச்' : u'சீ', u'ஞ்' : u'ஞீ', u'ட்' : u'டீ', u'ண்' : u'ணீ',
+ u'த்' : u'தீ', u'ந்' : u'நீ', u'ப்' : u'பீ', u'ம்' : u'மீ', u'ய்' : u'யீ', u'ர்' : u'ரீ',
+ u'ல்' : u'லீ', u'வ்' : u'வீ', u'ழ்' : u'ழீ', u'ள்' : u'ளீ', u'ற்' : u'றீ', u'ன்' : u'னீ',
+ u'ஜ்' : u'ஜீ', u'ஷ்' : u'ஷீ', u'ஸ்' : u'ஸீ', u'ஹ்' : u'ஹீ'
+ },
+ u'உ' : {
+ u'க்' : u'கு', u'ங்' : u'ஙு', u'ச்' : u'சு', u'ஞ்' : u'ஞு', u'ட்' : u'டு', u'ண்' : u'ணு',
+ u'த்' : u'து', u'ந்' : u'நு', u'ப்' : u'பு', u'ம்' : u'மு', u'ய்' : u'யு', u'ர்' : u'ரு',
+ u'ல்' : u'லு', u'வ்' : u'வு', u'ழ்' : u'ழு', u'ள்' : u'ளு', u'ற்' : u'று', u'ன்' : u'னு',
+ u'ஜ்' : u'ஜு', u'ஷ்' : u'ஷு', u'ஸ்' : u'ஸு', u'ஹ்' : u'ஹு'
+ },
+ u'ஊ' : {
+ u'க்' : u'கூ', u'ங்' : u'ஙூ', u'ச்' : u'சூ', u'ஞ்' : u'ஞூ', u'ட்' : u'டூ', u'ண்' : u'ணூ',
+ u'த்' : u'தூ', u'ந்' : u'நூ', u'ப்' : u'பூ', u'ம்' : u'மூ', u'ய்' : u'யூ', u'ர்' : u'ரூ',
+ u'ல்' : u'லூ', u'வ்' : u'வூ', u'ழ்' : u'ழூ', u'ள்' : u'ளூ', u'ற்' : u'றூ', u'ன்' : u'னூ',
+ u'ஜ்' : u'ஜூ', u'ஷ்' : u'ஷூ', u'ஸ்' : u'ஸூ', u'ஹ்' : u'ஹூ'
+ },
+ u'எ' : {
+ u'க்' : u'கெ', u'ங்' : u'ஙெ', u'ச்' : u'செ', u'ஞ்' : u'ஞெ', u'ட்' : u'டெ', u'ண்' : u'ணெ',
+ u'த்' : u'தெ', u'ந்' : u'நெ', u'ப்' : u'பெ', u'ம்' : u'மெ', u'ய்' : u'யெ', u'ர்' : u'ரெ',
+ u'ல்' : u'லெ', u'வ்' : u'வெ', u'ழ்' : u'ழெ', u'ள்' : u'ளெ', u'ற்' : u'றெ', u'ன்' : u'னெ',
+ u'ஜ்' : u'ஜெ', u'ஷ்' : u'ஷெ', u'ஸ்' : u'ஸெ', u'ஹ்' : u'ஹெ'
+ },
+ u'ஏ' : {
+ u'க்' : u'கே', u'ங்' : u'ஙே', u'ச்' : u'சே', u'ஞ்' : u'ஞே', u'ட்' : u'டே', u'ண்' : u'ணே',
+ u'த்' : u'தே', u'ந்' : u'நே', u'ப்' : u'பே', u'ம்' : u'மே', u'ய்' : u'யே', u'ர்' : u'ரே',
+ u'ல்' : u'லே', u'வ்' : u'வே', u'ழ்' : u'ழே', u'ள்' : u'ளே', u'ற்' : u'றே', u'ன்' : u'னே',
+ u'ஜ்' : u'ஜே', u'ஷ்' : u'ஷே', u'ஸ்' : u'ஸே', u'ஹ்' : u'ஹே'
+ },
+ u'ஐ' : {
+ u'க்' : u'கை', u'ங்' : u'ஙை', u'ச்' : u'சை', u'ஞ்' : u'ஞை', u'ட்' : u'டை', u'ண்' : u'ணை',
+ u'த்' : u'தை', u'ந்' : u'நை', u'ப்' : u'பை', u'ம்' : u'மை', u'ய்' : u'யை', u'ர்' : u'ரை',
+ u'ல்' : u'லை', u'வ்' : u'வை', u'ழ்' : u'ழை', u'ள்' : u'ளை', u'ற்' : u'றை', u'ன்' : u'னை',
+ u'ஜ்' : u'ஜை', u'ஷ்' : u'ஷை', u'ஸ்' : u'ஸை', u'ஹ்' : u'ஹை'
+ },
+ u'ஒ' : {
+ u'க்' : u'கொ', u'ங்' : u'ஙொ', u'ச்' : u'சொ', u'ஞ்' : u'ஞொ', u'ட்' : u'டொ', u'ண்' : u'ணொ',
+ u'த்' : u'தொ', u'ந்' : u'நொ', u'ப்' : u'பொ', u'ம்' : u'மொ', u'ய்' : u'யொ', u'ர்' : u'ரொ',
+ u'ல்' : u'லொ', u'வ்' : u'வொ', u'ழ்' : u'ழொ', u'ள்' : u'ளொ', u'ற்' : u'றொ', u'ன்' : u'னொ',
+ u'ஜ்' : u'ஜொ', u'ஷ்' : u'ஷொ', u'ஸ்' : u'ஸொ', u'ஹ்' : u'ஹொ'
+ },
+ u'ஓ' : {
+ u'க்' : u'கோ', u'ங்' : u'ஙோ', u'ச்' : u'சோ', u'ஞ்' : u'ஞோ', u'ட்' : u'டோ', u'ண்' : u'ணோ',
+ u'த்' : u'தோ', u'ந்' : u'நோ', u'ப்' : u'போ', u'ம்' : u'மோ', u'ய்' : u'யோ', u'ர்' : u'ரோ',
+ u'ல்' : u'லோ', u'வ்' : u'வோ', u'ழ்' : u'ழோ', u'ள்' : u'ளோ', u'ற்' : u'றோ', u'ன்' : u'னோ',
+ u'ஜ்' : u'ஜோ', u'ஷ்' : u'ஷோ', u'ஸ்' : u'ஸோ', u'ஹ்' : u'ஹோ'
+ },
+ u'ஔ' : {
+ u'க்' : u'கௌ', u'ங்' : u'ஙௌ', u'ச்' : u'சௌ', u'ஞ்' : u'ஞௌ', u'ட்' : u'டௌ', u'ண்' : u'ணௌ',
+ u'த்' : u'தௌ', u'ந்' : u'நௌ', u'ப்' : u'பௌ', u'ம்' : u'மௌ', u'ய்' : u'யௌ', u'ர்' : u'ரௌ',
+ u'ல்' : u'லௌ', u'வ்' : u'வௌ', u'ழ்' : u'ழௌ', u'ள்' : u'ளௌ', u'ற்' : u'றௌ', u'ன்' : u'னௌ',
+ u'ஜ்' : u'ஜௌ', u'ஷ்' : u'ஷௌ', u'ஸ்' : u'ஸௌ', u'ஹ்' : u'ஹௌ'
+ }
+ }
+
+
+## Other tuples used for testing
+
+COMBINATION_ENDINGS_TUPLE = (u'\u0BBE', # ஆ -> ா
+ u'\u0BBF', # இ -> ி
+ u'\u0BC0', # ஈ -> ீ
+ u'\u0BC1', # உ -> ு
+ u'\u0BC2', # ஊ -> ூ
+ u'\u0BC6', # எ -> ெ
+ u'\u0BC7', # ஏ -> ே
+ u'\u0BC8', # ஐ -> ை
+ u'\u0BCA', # ஒ -> ொ
+ u'\u0BCB', # ஓ -> ோ
+ u'\u0BCC' # ஔ -> ௌ
+ )
+PULLI = u'்'
+AYTHAM = u'ஃ'
+
+VALLINAM_CONSONANTS = (u'க்', u'ச்', u'ட்', u'த்', u'ப்', u'ற்')
+MELLINAM_CONSONANTS = (u'ங்', u'ஞ்', u'ண்', u'ந்', u'ம்', u'ன்')
+IDAIYINAM_CONSONANTS = (u'ய்',u'ர்', u'ல்', u'வ்', u'ழ்', u'ள்')
+GRANTHA_CONSONANTS = (u'ஜ்', u'ஷ்', u'ஸ்', u'ஹ்') # removed support for 'க்ஷ்' temporarily and ஶ் permanently
+
+KURIL_VOWELS = (u'அ', u'இ', u'உ', u'எ', u'ஒ')
+NEDIL_VOWELS = (u'ஆ', u'ஈ', u'ஊ', u'ஏ', u'ஐ', u'ஓ', u'ஔ')
+
+A_COMBINATIONS = (u'அ', u'ஆ', u'இ', u'ஈ', u'உ', u'ஊ', u'எ', u'ஏ', u'ஐ', u'ஒ', u'ஓ', u'ஔ')
+
+
+class EzhuthuTest(unittest.TestCase):
+ """
+ A test class for the Ezhuthu module
+ """
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+
+ ## Test is_aytham() on aytham, vowels, consonants and combinations
+
+ def testIsAytham_Aytham(self):
+ """is_aytham should return True for aytham"""
+
+ print "Testing Ezhuthu.is_aytham() with aytham - expecting True",
+
+ self.assertTrue(Ezhuthu.is_aytham(u'ஃ'))
+
+ print ".... pass"
+
+ def testIsAytham_Vowels(self):
+ """is_aytham should return False for all vowels"""
+
+ print "Testing Ezhuthu.is_aytham() with vowels - expecting True",
+
+ for vowel in Ezhuthu.get_vowels():
+
+ self.assertFalse(Ezhuthu.is_aytham(vowel))
+
+ print ".... pass"
+
+ def testIsAytham_Consonants(self):
+ """is_aytham should return False for all consonants"""
+
+ print "Testing Ezhuthu.is_aytham() with consonants - expecting False",
+
+ for consonant in Ezhuthu.get_consonants():
+
+ self.assertFalse(Ezhuthu.is_aytham(consonant))
+
+ print ".... pass"
+
+ def testIsAytham_Combinations(self):
+ """is_aytham should return False for all combinations"""
+
+ print "Testing Ezhuthu.is_aytham() with combinations - expecting False",
+
+ for combination in COMBINATIONS.values():
+
+ self.assertFalse(Ezhuthu.is_aytham(combination))
+
+ print ".... pass"
+
+
+ ## Test is_vowel() with aytham, vowels, consonants and combinations
+
+ def testIsVowel_Aytham(self):
+ """is_vowel should return True for aytham"""
+
+ print "Testing Ezhuthu.is_vowel() with aytham - expecting False",
+
+ self.assertFalse(Ezhuthu.is_vowel(Ezhuthu.get_aytham()))
+
+ print ".... pass"
+
+ def testIsVowel_Vowels(self):
+ """is_vowel should return True for all vowels"""
+
+ print "Testing Ezhuthu.is_vowel() with vowels - expecting True",
+
+ for vowel in Ezhuthu.get_vowels():
+
+ self.assertTrue(Ezhuthu.is_vowel(vowel))
+
+ print ".... pass"
+
+ def testIsVowel_Consonants(self):
+ """is_vowel should return False for all consonants"""
+
+ print "Testing Ezhuthu.is_vowel() with consonants - expecting False",
+
+ for consonant in Ezhuthu.get_consonants():
+
+ self.assertFalse(Ezhuthu.is_vowel(consonant))
+
+ print ".... pass"
+
+ def testIsVowel_Combinations(self):
+ """is_vowel should return False for all combinations"""
+
+ print "Testing Ezhuthu.is_vowel() with combinations - expecting False",
+
+ for combination in COMBINATIONS.values():
+
+ self.assertFalse(Ezhuthu.is_vowel(combination))
+
+ print ".... pass"
+
+
+ ## Test is_consonant() with aytham, vowels, consonants and combinations
+
+ def testIsConsonant_Aytham(self):
+ """is_consonant should return False for aytham"""
+
+ print "Testing Ezhuthu.is_consonant() with aytham - expecting False",
+
+ self.assertFalse(Ezhuthu.is_consonant(Ezhuthu.get_aytham()))
+
+ print ".... pass"
+
+ def testIsConsonant_Vowels(self):
+ """is_consonant should return False for all vowels"""
+
+ print "Testing Ezhuthu.is_consonant() with vowels - expecting False",
+
+ for vowel in Ezhuthu.get_vowels():
+
+ self.assertFalse(Ezhuthu.is_consonant(vowel))
+
+ print ".... pass "
+
+ def testIsConsonant_Consonants(self):
+ """is_consonant should return True for all consonants"""
+
+ print "Testing Ezhuthu.is_consonant() with consonants - expecting True",
+
+ for consonant in Ezhuthu.get_consonants():
+
+ self.assertTrue(Ezhuthu.is_consonant(consonant))
+
+ print ".... pass"
+
+ def testIsConsonant_Combinations(self):
+ """is_consonant should return False for all combinations"""
+
+ print "Testing Ezhuthu.is_consonant() with combinations - expecting False",
+
+ for combination in COMBINATIONS.values():
+
+ self.assertFalse(Ezhuthu.is_consonant(combination))
+
+ print ".... pass"
+
+
+
+ ## Test is_combination() with aytham, vowels, consonants and combinations
+
+ def testIsCombination_Aytham(self):
+ """is_combination should return True for aytham"""
+
+ print "Testing Ezhuthu.is_combination() with aytham - expecting False",
+
+ self.assertFalse(Ezhuthu.is_combination(Ezhuthu.get_aytham()))
+
+ print ".... pass"
+
+ def testIsCombination_Vowels(self):
+ """is_combination should return False for all vowels"""
+
+ print "Testing Ezhuthu.is_combination() with vowels - expecting False",
+
+ for vowel in Ezhuthu.get_vowels():
+
+ self.assertFalse(Ezhuthu.is_combination(vowel))
+
+ print ".... pass "
+
+ def testIsCombination_Consonants(self):
+ """is_combination should return False for all consonants"""
+
+ print "Testing Ezhuthu.is_combination() with consonants - expecting True",
+
+ for consonant in Ezhuthu.get_consonants():
+
+ self.assertFalse(Ezhuthu.is_combination(consonant))
+
+ print ".... pass"
+
+ def testIsCombination_Combinations(self):
+ """is_combination should return True for all combinations"""
+
+ print "Testing Ezhuthu.is_combination() with combinations - expecting False",
+
+ for combination in COMBINATIONS.values():
+
+ self.assertTrue(Ezhuthu.is_combination(combination))
+
+ print ".... pass"
+
+
+## Test get_script_name()
+
+ def testGetScriptName_Tamil(self):
+ """ get_script_name() should return the name of the script that the unicode character is encoded in """
+
+ print "Testing Ezhuthu.get_script_name() with Tamil letters",
+
+ tamil_letters = tuple(Ezhuthu.get_vowels())+tuple(Ezhuthu.get_consonants())+tuple(COMBINATIONS.values())
+
+ # Go through each Tamil letter
+ for letter in tamil_letters:
+
+ # format in title case
+ result_script_name = Ezhuthu.get_script_name(letter).title()
+ script_name = 'TAMIL'.title()
+
+
+ # check for equality
+ self.assertEqual(script_name, result_script_name, "Error on letter \'%s\' from script \'%s\'. Function returned \'%s\'" %(letter, script_name, result_script_name))
+
+ print ".... pass"
+
+
+ def testGetScriptName_otherLanguages(self):
+ """ get_script_name() should return the name of the script that the unicode character is encoded in """
+
+ print "Testing Ezhuthu.get_script_name() with letters from other scripts",
+
+ other_languages = {
+ u'ඐ' : 'SINHALA', u'එ' : 'SINHALA', u'ඒ' : 'SINHALA', u'ඓ' : 'SINHALA',
+ u'ඔ' : 'SINHALA', u'ඕ' : 'SINHALA', u'ඖ' : 'SINHALA', u'ඳ' : 'SINHALA',
+ u'ප' : 'SINHALA', u'ඵ' : 'SINHALA', u'බ' : 'SINHALA', u'භ' : 'SINHALA',
+ u'ම' : 'SINHALA', u'ඹ' : 'SINHALA', u'ය' : 'SINHALA', u'ර' : 'SINHALA',
+
+ u'ഠ' : 'MALAYALAM', u'ഡ' : 'MALAYALAM', u'ഢ' : 'MALAYALAM', u'ണ' : 'MALAYALAM', u'ത' : 'MALAYALAM',
+ u'ഥ' : 'MALAYALAM', u'ദ' : 'MALAYALAM', u'ധ' : 'MALAYALAM', u'ന' : 'MALAYALAM',
+
+ u'ಠ' : 'KANNADA', u'ಡ' : 'KANNADA', u'ಢ' : 'KANNADA', u'ಣ' : 'KANNADA', u'ತ' : 'KANNADA',
+ u'ಥ' : 'KANNADA', u'ದ' : 'KANNADA', u'ಧ' : 'KANNADA', u'ನ' : 'KANNADA',
+
+ u'ఠ' : 'TELUGU', u'డ' : 'TELUGU', u'ఢ' : 'TELUGU', u'ణ' : 'TELUGU', u'త' : 'TELUGU',
+ u'థ' : 'TELUGU', u'ద' : 'TELUGU', u'ధ' : 'TELUGU', u'న' : 'TELUGU',
+
+ u'ऐ' : 'DEVANAGARI', u'ऑ' : 'DEVANAGARI', u'ऒ' : 'DEVANAGARI', u'ओ' : 'DEVANAGARI',
+ u'औ' : 'DEVANAGARI', u'क' : 'DEVANAGARI', u'ख' : 'DEVANAGARI', u'ग' : 'DEVANAGARI',
+ u'घ' : 'DEVANAGARI', u'ङ' : 'DEVANAGARI', u'च' : 'DEVANAGARI', u'छ' : 'DEVANAGARI',
+ u'ज' : 'DEVANAGARI', u'झ' : 'DEVANAGARI', u'ञ' : 'DEVANAGARI', u'ट' : 'DEVANAGARI',
+
+ u'A' : 'LATIN', u'B' : 'LATIN', u'C' : 'LATIN', u'D' : 'LATIN', u'E' : 'LATIN',
+ u'F' : 'LATIN', u'G' : 'LATIN', u'H' : 'LATIN', u'I' : 'LATIN', u'J' : 'LATIN',
+ u'K' : 'LATIN', u'L' : 'LATIN', u'M' : 'LATIN', u'N' : 'LATIN', u'O' : 'LATIN',
+
+ u'ฐ' : 'THAI', u'ฑ' : 'THAI', u'ฒ' : 'THAI', u'ณ' : 'THAI', u'ด' : 'THAI', u'ต' : 'THAI',
+ u'ถ' : 'THAI', u'ท' : 'THAI', u'ธ' : 'THAI', u'น' : 'THAI', u'บ' : 'THAI',
+ u'ป' : 'THAI', u'ผ' : 'THAI', u'ฝ' : 'THAI', u'พ' : 'THAI', u'ฟ' : 'THAI',
+
+ u'໐' : 'LAO', u'໑' : 'LAO', u'໒' : 'LAO', u'໓' : 'LAO', u'໔' : 'LAO', u'໕' : 'LAO',
+ u'໖' : 'LAO', u'໗' : 'LAO', u'໘' : 'LAO', u'໙' : 'LAO', u'ດ' : 'LAO', u'ຕ' : 'LAO',
+ u'ຖ' : 'LAO', u'ທ' : 'LAO', u'ນ' : 'LAO', u'ບ' : 'LAO', u'ປ' : 'LAO', u'ຜ' : 'LAO',
+ u'ຝ' : 'LAO', u'ພ' : 'LAO', u'ຟ' : 'LAO',
+
+ u'ཐ' : 'TIBETAN', u'ད' : 'TIBETAN', u'དྷ' : 'TIBETAN', u'ན' : 'TIBETAN', u'པ' : 'TIBETAN',
+ u'ཕ' : 'TIBETAN', u'བ' : 'TIBETAN', u'བྷ' : 'TIBETAN', u'མ' : 'TIBETAN', u'ཙ' : 'TIBETAN',
+ u'ཚ' : 'TIBETAN', u'ཛ' : 'TIBETAN', u'ཛྷ' : 'TIBETAN', u'ཝ' : 'TIBETAN', u'ཞ' : 'TIBETAN',
+ u'ཟ' : 'TIBETAN',
+
+ u'ថ' : 'KHMER', u'ទ' : 'KHMER', u'ធ' : 'KHMER', u'ន' : 'KHMER', u'ប' : 'KHMER',
+ u'ផ' : 'KHMER', u'ព' : 'KHMER', u'ភ' : 'KHMER', u'ម' : 'KHMER', u'យ' : 'KHMER',
+ u'រ' : 'KHMER', u'ល' : 'KHMER', u'វ' : 'KHMER', u'ឝ' : 'KHMER', u'ឞ' : 'KHMER',
+ u'ស' : 'KHMER',
+
+ u'ᠠ' : 'MONGOLIAN', u'ᠡ' : 'MONGOLIAN', u'ᠢ' : 'MONGOLIAN', u'ᠣ' : 'MONGOLIAN',
+ u'ᠤ' : 'MONGOLIAN', u'ᠥ' : 'MONGOLIAN', u'ᠦ' : 'MONGOLIAN', u'ᠧ' : 'MONGOLIAN',
+ u'ᠨ' : 'MONGOLIAN', u'ᠩ' : 'MONGOLIAN', u'ᠪ' : 'MONGOLIAN', u'ᠫ' : 'MONGOLIAN',
+ u'ᠬ' : 'MONGOLIAN', u'ᠭ' : 'MONGOLIAN', u'ᠮ' : 'MONGOLIAN', u'ᠯ' : 'MONGOLIAN'
+ }
+
+ # Go through each key, value pair from above
+ for letter in other_languages:
+
+ # format in title case
+ result_script_name = Ezhuthu.get_script_name(letter).title()
+ script_name = other_languages[letter].title()
+
+ # check for equality
+ self.assertEqual(script_name, result_script_name, "Error on letter \'%s\' from script \'%s\'. Function returned \'%s\'" %(letter, script_name, result_script_name))
+
+ print ".... pass"
+
+ def testIsKuril_kuril(self):
+ """ is_kuril() should return True for all kuril letters """
+
+ print "Testing Ezhuthu.is_kuril() with kuril letters",
+
+ for vowel in KURIL_VOWELS:
+
+ # all the kuril vowels should return true
+ self.assertTrue(Ezhuthu.is_kuril(vowel), "Vowel \'%s\' returned False for is_kuril(). Should return True." %(vowel))
+
+ # all combinations made from kuril vowels should also return true
+ for combination in Ezhuthu.get_combination_column(vowel).values():
+ self.assertTrue(Ezhuthu.is_kuril(combination), "Combination \'%s\' returned False for is_kuril(). Should return True." %(combination))
+
+ print ".... pass"
+
+ def testIsKuril_nedil(self):
+ """ is_kuril() should return False for all nedil letters """
+
+ print "Testing Ezhuthu.is_kuril() with nedil letters",
+
+ for vowel in NEDIL_VOWELS:
+
+ # all the kuril vowels should return true
+ self.assertFalse(Ezhuthu.is_kuril(vowel), "Vowel \'%s\' returned True for is_kuril(). Should return False." %(vowel))
+
+ # all combinations made from kuril vowels should also return false
+ for combination in Ezhuthu.get_combination_column(vowel):
+ self.assertFalse(Ezhuthu.is_kuril(combination), "Combination \'%s\' returned True for is_kuril(). Should return False." %(combination))
+
+ print ".... pass"
+
+ def testIsKuril_consonantsAndAytham(self):
+ """ is_kuril() should return False for all consonants and for aytham """
+
+ # first test consonants
+ print "Testing Ezhuthu.is_kuril() with consonants",
+
+ for consonant in Ezhuthu.get_consonants():
+
+ self.assertFalse(Ezhuthu.is_kuril(consonant), "Consonant \'%s\' returned True for is_kuril(). Should return False.")
+
+ print ".... pass"
+
+
+ #now test aytham
+ print "Testing Ezhuthu.is_kuril() with aytham (ஃ)",
+
+ self.assertFalse(Ezhuthu.is_kuril(AYTHAM), "Aytham (\'%s\') returned True for is_kuril(). Should return False." %AYTHAM)
+
+ print ".... pass"
+
+
+ def testIsNedil_kuril(self):
+ """ is_nedil() should True for all kuril letters """
+
+ print "Testing Ezhuthu.is_nedil() with kuril letters",
+
+ for vowel in KURIL_VOWELS:
+
+ # all the kuril vowels should return false
+ self.assertFalse(Ezhuthu.is_nedil(vowel), "Vowel \'%s\' returned True for is_nedil(). Should return False." %(vowel))
+
+ # all combinations made from kuril vowels should also return false
+ for combination in Ezhuthu.get_combination_column(vowel):
+ self.assertFalse(Ezhuthu.is_nedil(combination), "Combination \'%s\' returned True for is_nedil(). Should return False." %(combination))
+
+ print ".... pass"
+
+ def testIsNedil_nedil(self):
+ """ is_nedil() should True for all kuril letters """
+
+ print "Testing Ezhuthu.is_nedil() with kuril letters",
+
+ for vowel in KURIL_VOWELS:
+
+ # all the kuril vowels should return false
+ self.assertFalse(Ezhuthu.is_nedil(vowel), "Vowel \'%s\' returned True for is_nedil(). Should return False." %(vowel))
+
+ # all combinations made from kuril vowels should also return false
+ for combination in Ezhuthu.get_combination_column(vowel):
+ self.assertFalse(Ezhuthu.is_nedil(combination), "Combination \'%s\' returned True for is_nedil(). Should return False." %(combination))
+
+ print ".... pass"
+
+ def testIsNedil_consonantsAndAytham(self):
+ """ is_nedil() should return False for all consonants and for aytham """
+
+ # first test consonants
+ print "Testing Ezhuthu.is_nedil() with consonants",
+
+ for consonant in Ezhuthu.get_consonants():
+
+ self.assertFalse(Ezhuthu.is_nedil(consonant), "Consonant \'%s\' returned True for is_nedil(). Should return False.")
+
+ print ".... pass"
+
+
+ #now test aytham
+ print "Testing Ezhuthu.is_nedil() with aytham (ஃ)",
+
+ self.assertFalse(Ezhuthu.is_nedil(AYTHAM), "Aytham (\'%s\') returned True for is_nedil(). Should return False." %AYTHAM)
+
+ print ".... pass"
+
+ def testGetAytham(self):
+ """ get_aytham() should return the Aytham (ஃ) character """
+
+ print "Testing Ezhuthu.get_aytham()",
+
+ expected = AYTHAM
+ received = Ezhuthu.get_aytham()
+
+ self.assertEqual(expected, received, "Expected Aytham (\'%s\'), but received \'%s\' instead" %(expected, received))
+
+
+ print ".... pass"
+
+ def testGetVowels(self):
+ """ get_vowels() should return a tuple of all the vowels """
+
+ print "Testing Ezhuthu.get_vowels()",
+
+ expected = KURIL_VOWELS + NEDIL_VOWELS
+ received = Ezhuthu.get_vowels()
+
+ #ensure that both expected and received are tuples
+ self.assertTrue(isinstance(expected,tuple), "\'%s\' should be a tuple, but is a %s" %(expected, type(expected)))
+ self.assertTrue(isinstance(received,tuple), "\'%s\' should be a tuple, but is a %s" %(received, type(received)))
+
+ #ensure that size of the two tuples is correct
+ self.assertEqual(len(expected), len(received), "Vowel Tuple should have %s members" %len(expected))
+
+ # compare as sets, to ignore order
+ self.assertEquals(set(expected), set(received), "Expected tuple \'%s\' but received tuple \'%s\'" %(expected, received))
+
+ print ".... pass"
+
+ def testGetConsonants(self):
+ """ get_consonants() should return a tuple of all the consonants """
+
+ print "Testing Ezhuthu.get_consonants()",
+
+ expected = VALLINAM_CONSONANTS + MELLINAM_CONSONANTS + IDAIYINAM_CONSONANTS + GRANTHA_CONSONANTS
+ received = Ezhuthu.get_consonants()
+
+ #ensure that both expected and received are tuples
+ self.assertTrue(isinstance(expected,tuple), "\'%s\' should be a tuple, but is a %s" %(expected, type(expected)))
+ self.assertTrue(isinstance(received,tuple), "\'%s\' should be a tuple, but is a %s" %(received, type(received)))
+
+ #ensure that size of the two tuples is correct
+ self.assertEqual(len(expected), len(received), "Consonant tuple should have %s members" %len(received))
+
+ # compare as sets, to ignore order
+ self.assertEquals(set(expected), set(received), "Expected tuple \'%s\' but received tuple \'%s\'" %(expected, received))
+
+ print ".... pass"
+
+ def testGetCombination_validInput(self):
+ """ get_combination() should return the result of combining a given consonant, vowel tuple """
+
+ print "Testing Ezhuthu.get_combination() with valid input (i.e. all possible with consonant, vowel) tuples",
+
+ # get tuple/list of consonants, vowels and combinations
+ consonants = Ezhuthu.get_consonants()
+ vowels = Ezhuthu.get_vowels()
+
+ # loop through each consonant, vowel pair
+ for consonant in consonants:
+
+ for vowel in vowels:
+
+ expected = COMBINATIONS[(consonant, vowel)]
+ received = Ezhuthu.get_combination(consonant, vowel)
+ self.assertEquals(expected, received, "The combination \'%s\' should have resulted from consonant \'%s\' and vowel \'%s\'. \'%s\' was received" %(expected, vowel, consonant, received))
+
+
+ print ".... pass"
+
+ def testGetCombination_invalidInput(self):
+ """ get_combination() should raise an exception if the input is not a consonant, vowel tuple """
+
+ # get tuple/list of consonants, vowels and combinations
+ consonants = Ezhuthu.get_consonants()
+ vowels = Ezhuthu.get_vowels()
+ combinations = COMBINATIONS.values()
+
+ # Test every possible vowel, vowel tuple. Should raise a ValueError
+ print "Testing Ezhuthu.get_combination() with vowel, vowel tuples",
+
+ for vowel1 in vowels:
+
+ for vowel2 in vowels:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination(vowel1, vowel2)
+
+ print ".... pass"
+
+
+ # Test every possible consonant, consonant tuple. Should raise a ValueError
+ print "Testing Ezhuthu.get_combination() with consonant, consonant tuples",
+
+ for consonant1 in consonants:
+
+ for consonant2 in consonants:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination(consonant1, consonant2)
+
+ print ".... pass"
+
+
+ # Test every possible combination, combination tuple. Should raise a ValueError
+ print "Testing Ezhuthu.get_combination() with combination, combination tuples",
+
+ for combination1 in combinations:
+
+ for combination2 in combinations:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination(combination1, combination2)
+
+ print ".... pass"
+
+
+ # Test every possible vowel, consonant combination (get_combination) expects consonant, vowel input
+ print "Testing Ezhuthu.get_combination() with vowel, consonant tuples (get_combination() expects the consonant first, then the vowel)",
+
+ for vowel in vowels:
+
+ for consonant in consonants:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination(vowel, consonant)
+
+ print ".... pass"
+
+
+ def testSplitCombination(self):
+ """ split_combination() should return the correct consonant, vowel tuple when given a letter """
+
+ # Test for all combinations
+ print "Testing Ezhuthu.split_combination() with all combinations",
+
+ for consonant_vowel_tuple in COMBINATIONS:
+
+ expected = consonant_vowel_tuple
+ received = Ezhuthu.split_combination(COMBINATIONS[consonant_vowel_tuple])
+
+ self.assertEquals(expected, received, "Expected tuple (\'%s\', \'%s\') for combination \'%s\'. Received tuple (\'%s\', \'%s\')" %(expected[0], expected[1], COMBINATIONS[consonant_vowel_tuple], received[0], received[1]))
+
+ print ".... pass"
+
+ # Test for all consonants
+ print "Testing Ezhuthu.split_combination() with all consonants",
+
+ consonants = Ezhuthu.get_consonants()
+
+ for consonant in consonants:
+
+ expected = (consonant, u'')
+ received = Ezhuthu.split_combination(consonant)
+
+ self.assertEquals(expected, received, "Expected tuple (\'%s\', \'%s\') for combination \'%s\'. Received tuple (\'%s\', \'%s\')" %(expected[0], expected[1], consonant, received[0], received[1]))
+
+ print ".... pass"
+
+ # Test for all vowels
+ print "Testing Ezhuthu.split_combination() with all combinations",
+
+ for consonant_vowel_tuple in COMBINATIONS:
+
+ expected = consonant_vowel_tuple
+ received = Ezhuthu.split_combination(COMBINATIONS[consonant_vowel_tuple])
+
+ self.assertEquals(expected, received, "Expected tuple (\'%s\', \'%s\') for combination \'%s\'. Received tuple (\'%s\', \'%s\')" %(expected[0], expected[1], COMBINATIONS[consonant_vowel_tuple], received[0], received[1]))
+
+ print ".... pass"
+
+ # Test for aytham
+ print "Testing Ezhuthu.split_combination() with all combinations",
+
+ for consonant_vowel_tuple in COMBINATIONS:
+
+ expected = consonant_vowel_tuple
+ received = Ezhuthu.split_combination(COMBINATIONS[consonant_vowel_tuple])
+
+ self.assertEquals(expected, received, "Expected tuple (\'%s\', \'%s\') for combination \'%s\'. Received tuple (\'%s\', \'%s\')" %(expected[0], expected[1], COMBINATIONS[consonant_vowel_tuple], received[0], received[1]))
+
+ print ".... pass"
+
+
+ def testGetLetterType(self):
+ """ get_letter_type() should return the letter type for a given letter (e.g. vowel, consonant, combination, aytham) """
+
+ # Test for Aytham
+ print "Testing Ezhuthu.get_letter_type() with Aytham (ஃ)",
+ letter = AYTHAM
+ expected = 'AYTHAM'
+ received = Ezhuthu.get_letter_type(letter)
+
+ self.assertEquals(expected, received, "Expected letter type \'%s\' for letter \'%s\'. Received \'%s\'" %(expected, letter, received))
+
+ print ".... pass"
+
+
+ # Test for vowels
+ print "Testing Ezhuthu.get_letter_type() with vowels",
+
+ vowels = Ezhuthu.get_vowels()
+
+ for vowel in vowels:
+ expected = 'VOWEL'
+ received = Ezhuthu.get_letter_type(vowel)
+
+ self.assertEquals(expected, received, "Expected letter type \'%s\' for letter \'%s\'. Received \'%s\'" %(expected, vowel, received))
+
+ print ".... pass"
+
+ # Test for consonants
+ print "Testing Ezhuthu.get_letter_type() with consonants",
+
+ consonants = Ezhuthu.get_consonants()
+
+ for consonant in consonants:
+ expected = 'CONSONANT'
+ received = Ezhuthu.get_letter_type(consonant)
+
+ self.assertEquals(expected, received, "Expected letter type \'%s\' for letter \'%s\'. Received \'%s\'" %(expected, consonant, received))
+
+ print ".... pass"
+
+
+ # Test for combinations
+ print "Testing Ezhuthu.get_letter_type() with combinations",
+
+ combinations = COMBINATIONS.values()
+
+ for combination in combinations:
+ expected = 'COMBINATION'
+ received = Ezhuthu.get_letter_type(combination)
+
+ self.assertEquals(expected, received, "Expected letter type \'%s\' for letter \'%s\'. Received \'%s\'" %(expected, combination, received))
+
+ print ".... pass"
+
+
+ def testGetVowelType_validInput(self):
+ """ get_vowel_type() should return the vowel type (kuril or nedil) for all vowels and combination """
+
+ # Test with kuril vowels
+ print "Testing Ezhuthu.get_vowel_type() with kuril vowels and their combinations",
+
+ for vowel in KURIL_VOWELS:
+
+ expected = 'KURIL'
+
+ # Test the vowel itself
+ received = Ezhuthu.get_vowel_type(vowel)
+ self.assertEquals(expected, received, "Expected vowel \'%s\' to be of type \'%s\'. Received \'%s\'." %(vowel, expected, received))
+
+ # Test for each combination involving a kuril vowel
+ combinations = Ezhuthu.get_combination_column(vowel).values()
+ for combination in combinations:
+
+ received = Ezhuthu.get_vowel_type(combination)
+ self.assertEquals(expected, received, "Expected vowel \'%s\' to be of type \'%s\'. Received \'%s\'." %(vowel, expected, received))
+
+ print ".... pass"
+
+
+ # Test with nedil vowels
+ print "Testing Ezhuthu.get_vowel_type() with nedil vowels and their combinations",
+
+ for vowel in NEDIL_VOWELS:
+
+ expected = 'NEDIL'
+
+ # Test the vowel itself
+ received = Ezhuthu.get_vowel_type(vowel)
+ self.assertEquals(expected, received, "Expected vowel \'%s\' to be of type \'%s\'. Received \'%s\'." %(vowel, expected, received))
+
+ # Test for each combination involving a kuril vowel
+ combinations = Ezhuthu.get_combination_column(vowel).values()
+ for combination in combinations:
+
+ received = Ezhuthu.get_vowel_type(combination)
+ self.assertEquals(expected, received, "Expected vowel \'%s\' to be of type \'%s\'. Received \'%s\'." %(vowel, expected, received))
+
+ print ".... pass"
+
+
+ def testGetVowelType_invalidInput(self):
+ """ get_vowel_type() should raise a ValueError for Aytham and consonants """
+
+ # Test with aytham
+ print "Testing Ezhuthu.get_vowel_type() with aytham",
+
+ letter = Ezhuthu.get_aytham()
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_vowel_type(letter)
+
+ print ".... pass"
+
+
+ # Test with all consonants
+ print "Testing Ezhuthu.get_vowel_type() with consonants",
+
+ consonants = Ezhuthu.get_consonants()
+
+ for consonant in consonants:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_vowel_type(consonant)
+
+ print ".... pass"
+
+
+ def testIsVallinam_TrueCases(self):
+ """ is_vallinam() should return True for all vallinam consonants """
+
+ print "Testing Ezhuthu.is_vallinam() with vallinam consonants",
+
+ for consonant in VALLINAM_CONSONANTS:
+
+ self.assertTrue(Ezhuthu.is_vallinam(consonant), "\'%s\' is a vallinam consonant, but is_vallinam() returned False" %consonant)
+
+ print ".... pass"
+
+
+ def testIsVallinam_FalseCases(self):
+ """ is_vallinam() should return False for aytham and for all vowels, combinations and mellinam, idaiyinam and grantha consonants """
+
+ # Test with aytham
+ print "Testing Ezhuthu.is_vallinam() with aytham",
+
+ letter = AYTHAM
+ self.assertFalse(Ezhuthu.is_vallinam(letter), "\'%s\' is Aytham, but is_vallinam() returned True" %letter)
+
+ print ".... pass"
+
+
+ # Test with vowels
+ print "Testing Ezhuthu.is_vallinam() with vowels",
+
+ vowels = Ezhuthu.get_vowels()
+ for vowel in vowels:
+
+ self.assertFalse(Ezhuthu.is_vallinam(vowel), "\'%s\' is a vowel, but is_vallinam() returned True" %vowel)
+
+ print ".... pass"
+
+
+ # Test with combinations
+ print "Testing Ezhuthu.is_vallinam() with combinations",
+
+ combinations = COMBINATIONS.values()
+ for combination in combinations:
+
+ self.assertFalse(Ezhuthu.is_vallinam(combination), "\'%s\' is a combination, but is_vallinam() returned True" %combination)
+
+ print ".... pass"
+
+
+ # Test with mellinam consonants
+ print "Testing Ezhuthu.is_vallinam() with mellinam consonant",
+
+ for consonant in MELLINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_vallinam(consonant), "\'%s\' is a mellinam consonant, but is_vallinam() returned True" %consonant)
+
+ print ".... pass"
+
+
+ # Test with idaiyinam consonants
+ print "Testing Ezhuthu.is_vallinam() with idaiyinam consonant",
+
+ for consonant in IDAIYINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_vallinam(consonant), "\'%s\' is an idaiyinam consonant, but is_vallinam() returned True" %consonant)
+
+ print ".... pass"
+
+
+ def testIsMellinam_TrueCases(self):
+ """ is_mellinam() should return True for all mellinam consonants """
+
+ print "Testing Ezhuthu.is_mellinam() with mellinam consonants",
+
+ for consonant in MELLINAM_CONSONANTS:
+
+ self.assertTrue(Ezhuthu.is_mellinam(consonant), "\'%s\' is a mellinam consonant, but is_mellinam() returned False" %consonant)
+
+ print ".... pass"
+
+
+ def testIsMellinam_FalseCases(self):
+ """ is_mellinam() should return False for aytham and for all vowels, combinations and vallinam, idaiyinam and grantha consonants """
+
+ # Test with aytham
+ print "Testing Ezhuthu.is_mellinam() with aytham",
+
+ letter = AYTHAM
+ self.assertFalse(Ezhuthu.is_mellinam(letter), "\'%s\' is Aytham, but is_mellinam() returned True" %letter)
+
+ print ".... pass"
+
+
+ # Test with vowels
+ print "Testing Ezhuthu.is_mellinam() with vowels",
+
+ vowels = Ezhuthu.get_vowels()
+ for vowel in vowels:
+
+ self.assertFalse(Ezhuthu.is_mellinam(vowel), "\'%s\' is a vowel, but is_mellinam() returned True" %vowel)
+
+ print ".... pass"
+
+
+ # Test with combinations
+ print "Testing Ezhuthu.is_mellinam() with combinations",
+
+ combinations = COMBINATIONS.values()
+ for combination in combinations:
+
+ self.assertFalse(Ezhuthu.is_mellinam(combination), "\'%s\' is a combination, but is_mellinam() returned True" %combination)
+
+ print ".... pass"
+
+
+ # Test with mellinam consonants
+ print "Testing Ezhuthu.is_mellinam() with vallinam consonant",
+
+ for consonant in VALLINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_mellinam(consonant), "\'%s\' is a vallinam consonant, but is_mellinam() returned True" %consonant)
+
+ print ".... pass"
+
+
+ # Test with idaiyinam consonants
+ print "Testing Ezhuthu.is_mellinam() with idaiyinam consonant",
+
+ for consonant in IDAIYINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_mellinam(consonant), "\'%s\' is an idaiyinam consonant, but is_mellinam() returned True" %consonant)
+
+ print ".... pass"
+
+ # Test with grantha consonants
+ print "Testing Ezhuthu.is_mellinam() with grantha consonant",
+
+ for consonant in GRANTHA_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_mellinam(consonant), "\'%s\' is a grantha consonant, but is_mellinam() returned True" %consonant)
+
+ print ".... pass"
+
+
+ def testIdaiyinam_TrueCases(self):
+ """ is_GRANTHA() should return True for all idaiyinam consonants """
+
+ print "Testing Ezhuthu.is_idaiyinam() with idaiyinam consonants",
+
+ for consonant in IDAIYINAM_CONSONANTS:
+
+ self.assertTrue(Ezhuthu.is_idaiyinam(consonant), "\'%s\' is a idaiyinam consonant, but is_idaiyinam() returned False" %consonant)
+
+ print ".... pass"
+
+
+ def testIdaiyinam_FalseCases(self):
+ """ is_idaiyinam() should return False for aytham and for all vowels, combinations and vallinam, mellinam and grantha consonants """
+
+ # Test with aytham
+ print "Testing Ezhuthu.is_idaiyinam() with aytham",
+
+ letter = AYTHAM
+ self.assertFalse(Ezhuthu.is_idaiyinam(letter), "\'%s\' is Aytham, but is_idaiyinam() returned True" %letter)
+
+ print ".... pass"
+
+
+ # Test with vowels
+ print "Testing Ezhuthu.is_idaiyinam() with vowels",
+
+ vowels = Ezhuthu.get_vowels()
+ for vowel in vowels:
+
+ self.assertFalse(Ezhuthu.is_idaiyinam(vowel), "\'%s\' is a vowel, but is_idaiyinam() returned True" %vowel)
+
+ print ".... pass"
+
+
+ # Test with combinations
+ print "Testing Ezhuthu.is_idaiyinam() with combinations",
+
+ combinations = COMBINATIONS.values()
+ for combination in combinations:
+
+ self.assertFalse(Ezhuthu.is_idaiyinam(combination), "\'%s\' is a combination, but is_idaiyinam() returned True" %combination)
+
+ print ".... pass"
+
+
+ # Test with idaiyinam consonants
+ print "Testing Ezhuthu.is_idaiyinam() with vallinam consonant",
+
+ for consonant in VALLINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_idaiyinam(consonant), "\'%s\' is a vallinam consonant, but is_idaiyinam() returned True" %consonant)
+
+ print ".... pass"
+
+
+ # Test with idaiyinam consonants
+ print "Testing Ezhuthu.is_idaiyinam() with mellinam consonant",
+
+ for consonant in MELLINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_idaiyinam(consonant), "\'%s\' is an mellinam consonant, but is_idaiyinam() returned True" %consonant)
+
+ print ".... pass"
+
+ # Test with grantha consonants
+ print "Testing Ezhuthu.is_idaiyinam() with grantha consonant",
+
+ for consonant in GRANTHA_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_idaiyinam(consonant), "\'%s\' is an grantha consonant, but is_idaiyinam() returned True" %consonant)
+
+ print ".... pass"
+
+
+ def testIsGrantha_TrueCases(self):
+ """ is_grantha() should return True for all grantha consonants """
+
+ print "Testing Ezhuthu.is_grantha() with grantha consonants",
+
+ for consonant in GRANTHA_CONSONANTS:
+
+ self.assertTrue(Ezhuthu.is_grantha(consonant), "\'%s\' is a grantha consonant, but is_grantha() returned False" %consonant)
+
+ print ".... pass"
+
+
+ def testIsGrantha_FalseCases(self):
+ """ is_grantha() should return False for aytham and for all vowels, combinations and vallinam, mellinam and idaiyinam consonants """
+
+ # Test with aytham
+ print "Testing Ezhuthu.is_grantha() with aytham",
+
+ letter = AYTHAM
+ self.assertFalse(Ezhuthu.is_grantha(letter), "\'%s\' is Aytham, but is_grantha() returned True" %letter)
+
+ print ".... pass"
+
+
+ # Test with vowels
+ print "Testing Ezhuthu.is_grantha() with vowels",
+
+ vowels = Ezhuthu.get_vowels()
+ for vowel in vowels:
+
+ self.assertFalse(Ezhuthu.is_grantha(vowel), "\'%s\' is a vowel, but is_grantha() returned True" %vowel)
+
+ print ".... pass"
+
+
+ # Test with combinations
+ print "Testing Ezhuthu.is_grantha() with combinations",
+
+ combinations = COMBINATIONS.values()
+ for combination in combinations:
+
+ self.assertFalse(Ezhuthu.is_grantha(combination), "\'%s\' is a combination, but is_grantha() returned True" %combination)
+
+ print ".... pass"
+
+
+ # Test with grantha consonants
+ print "Testing Ezhuthu.is_grantha() with vallinam consonant",
+
+ for consonant in VALLINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_grantha(consonant), "\'%s\' is a vallinam consonant, but is_grantha() returned True" %consonant)
+
+ print ".... pass"
+
+
+ # Test with grantha consonants
+ print "Testing Ezhuthu.is_grantha() with mellinam consonant",
+
+ for consonant in MELLINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_grantha(consonant), "\'%s\' is an mellinam consonant, but is_grantha() returned True" %consonant)
+
+ print ".... pass"
+
+ # Test with grantha consonants
+ print "Testing Ezhuthu.is_grantha() with idaiyinam consonant",
+
+ for consonant in IDAIYINAM_CONSONANTS:
+
+ self.assertFalse(Ezhuthu.is_grantha(consonant), "\'%s\' is an idaiyinam consonant, but is_grantha() returned True" %consonant)
+
+ print ".... pass"
+
+ def testGetCombinationColumn_validInput(self):
+ """ get_combination_column() should return a dictionary mapping consonant -> combination for a given vowel """
+
+ print "Testing Ezhuthu.get_combination_column() with vowels",
+
+ vowels = Ezhuthu.get_vowels()
+
+ # ensure that the correct row is returned for each vowel
+ for vowel in vowels:
+
+ expected = COMBINATIONS_BY_VOWEL[vowel]
+ received = Ezhuthu.get_combination_column(vowel)
+
+ self.assertEquals(expected, received, "Expected dictionary %s to be equal to dictionary %s" %(expected, received))
+
+
+ print ".... pass"
+
+
+ def testGetCombinationColumn_invalidInput(self):
+ """ get_combination_column() should raise a ValueError for all consonants, combinations and aytham """
+
+ # Test Aytham
+ print "Testing Ezhuthu.get_combination_column() with Aytham (ஃ) - expecting ValueError",
+
+ letter = AYTHAM
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination_column(letter)
+
+ print ".... pass"
+
+ # Test consonants
+ print "Testing Ezhuthu.get_combination_column() with consonants - expecting ValueError",
+
+ consonants = Ezhuthu.get_consonants()
+ for consonant in consonants:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination_column(consonant)
+
+ print ".... pass"
+
+ # Test Combinations
+ print "Testing Ezhuthu.get_combination_column() with combinations - expecting ValueError",
+
+ combinations = COMBINATIONS.values()
+
+ for combination in combinations:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination_column(combination)
+
+ print ".... pass"
+
+
+ def testGetCombinationRow_validInput(self):
+ """ get_combination_row() should return a dictionary mapping vowel -> combination for a given consonant """
+
+ print "Testing Ezhuthu.get_combination_row() with consonants - Expecting a dictionary of vowel->combination mappings for the given consonant",
+
+ consonants = Ezhuthu.get_consonants()
+
+ # ensure that the correct row is returned for each consonant
+ for consonant in consonants:
+
+ expected = COMBINATIONS_BY_CONSONANT[consonant]
+ received = Ezhuthu.get_combination_row(consonant)
+
+ self.assertEquals(expected, received, "Expected dictionary %s to be equal to dictionary %s" %(expected, received))
+
+
+ print ".... pass"
+
+
+ def testGetCombinationRow_invalidInput(self):
+ """ get_combination_row() should raise a ValueError for all consonants, combinations and aytham """
+
+ # Test Aytham
+ print "Testing Ezhuthu.get_combination_row() with Aytham (ஃ) - expecting ValueError",
+
+ letter = AYTHAM
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination_row(letter)
+
+ print ".... pass"
+
+ # Test consonants
+ print "Testing Ezhuthu.get_combination_row() with vowels - expecting ValueError",
+
+ vowels = Ezhuthu.get_vowels()
+ for vowel in vowels:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination_row(vowel)
+
+ print ".... pass"
+
+ # Test Combinations
+ print "Testing Ezhuthu.get_combination_row() with combinations - expecting ValueError",
+
+ combinations = COMBINATIONS.values()
+
+ for combination in combinations:
+
+ with self.assertRaises(ValueError):
+ _ = Ezhuthu.get_combination_row(combination)
+
+ print ".... pass"
+
+
+ def testGetCombinationEndings(self):
+ """ get_combination_endings() should return a tuple of all the combination endings """
+
+ print "Testing Ezhuthu.get_combination_endings()",
+
+ expected_tuple = COMBINATION_ENDINGS_TUPLE
+ received_tuple = Ezhuthu.get_combination_endings()
+
+ self.assertEqual(set(expected_tuple), set(received_tuple), "Expected tuple \'%s\' but received \'%s\'" %(expected_tuple, received_tuple) )
+
+ print ".... pass"
+
+
+
+def suite():
+ suite = unittest.TestSuite()
+ suite.addTest(unittest.makeSuite(EzhuthuTest))
+ return suite
+
+def main():
+ runner = unittest.TextTestResult()
+ test_suite = suite()
+ runner.run(test_suite)
+
+
+if __name__ == '__main__':
+ main()