diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..c334622 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,8 @@ +Balasankar C +Diadara +Jerin Philip +Jishnu Mohan +Nithin Saji +Vasudev Kamath +Vasudev Kamath +diadara diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..f01941a --- /dev/null +++ b/ChangeLog @@ -0,0 +1,47 @@ +CHANGES +======= + +* Make test running and coverage analysis consider namespace package +* Make libindic a namespace package +* Update readme for matching new directory structure +* Add CircleCI configuration file +* Add tox integration +* Add a test for Malayalam syllablengram +* Add travis +* Fix package name +* Add testrepository support +* Tweak tests to use testtools +* Move to libindic.module strucure +* Ignore intermediate files during build and test +* Add requirements for running and tests +* Add makefile for building +* Move tests to package +* Use pbr for packaging +* PEP8 compliance +* Run Autopep8 on docs +* Fix relative imports for Python3 sypport +* Fixing broken link +* add jquery.ime +* new ui +* javascript code improvements +* Version bumped 0.4. Docs added and template renamed +* changin template to reflect module rename +* adding an intro to docs +* adding sphinx based docs +* adding more docstrings +* pep8 cleaning in tests +* added test cases for english +* template name needs to match module name +* Bumped version to 0.3 +* rename syllabalizer module to indicsyllabifier +* Version is bumped to 0.2 +* Package depend on indicsyllabifier not syllabalizer +* Module named as indicngram +* Version is 0.1 and wrap long description +* Wrap lines to 80 characters +* Ignore .ropeproject created by elpy +* added templates +* fixed imports +* pep8 cleaning +* Update README.md +* Initial commit diff --git a/libindic/ngram/__init__.py b/libindic/ngram/__init__.py index 4be3a97..30823e6 100644 --- a/libindic/ngram/__init__.py +++ b/libindic/ngram/__init__.py @@ -19,12 +19,17 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # import indicsyllabifier - +import normalizer class Ngram: """ Ngram class.You need to create an object to use the function """ + + + def __init__(self): + self.s=indicsyllabifier.getInstance() + self.n=normalizer.getInstance() def syllableNgram(self, text, window_size=2): """ @@ -37,10 +42,17 @@ def syllableNgram(self, text, window_size=2): window_size = int(window_size) words = text.split(" ") ngrams = [] + + # s = indicsyllabifier.getInstance() + # n = normalizer.getInstance() ## + for word in words: - s = indicsyllabifier.getInstance() + # TODO-Normalize before taking ngram!!! - syllables = s.syllabify(word) + + word=self.n.normalize(word) ## + + syllables = self.s.syllabify(word) syllable_count = len(syllables) window_start = 0 window_end = 0