diff options
author | Santhosh Thottingal <santhosh.thottingal@gmail.com> | 2009-03-29 17:59:40 +0530 |
---|---|---|
committer | Santhosh Thottingal <santhosh.thottingal@gmail.com> | 2009-03-29 17:59:40 +0530 |
commit | c5368252e3091368ae55475757ed3134d6f84249 (patch) | |
tree | 09687b84ab042ba9d339dec9d1d92ecc377d0bac /silpa/utils/langdetect.py | |
parent | f37edebde2304ee0643804166bf19ffee5c9dba5 (diff) | |
download | Rachana.git-c5368252e3091368ae55475757ed3134d6f84249.tar.gz Rachana.git-c5368252e3091368ae55475757ed3134d6f84249.tar.xz Rachana.git-c5368252e3091368ae55475757ed3134d6f84249.zip |
new modules
Diffstat (limited to 'silpa/utils/langdetect.py')
-rw-r--r-- | silpa/utils/langdetect.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/silpa/utils/langdetect.py b/silpa/utils/langdetect.py index c20ac3a..727ea6d 100644 --- a/silpa/utils/langdetect.py +++ b/silpa/utils/langdetect.py @@ -4,8 +4,9 @@ # Copyright © 2008 Santhosh Thottingal # Released under the GPLV3+ license +from common import * -class LangDetect: +class LangDetect(SilpaModule): def detect_lang(self, text): words=text.split(" ") @@ -63,11 +64,16 @@ class LangDetect: response=response % text detected_lang_dict = self.detect_lang(text) response = response+"<h2>Language Detection Results</h2></hr>" - response = response+"<table><th><td>Word</td><td>Language</td></th>" + response = response+"<table class=\"table1\"><tr><th>Word</th><th>Language</th></tr>" for key in detected_lang_dict: response = response+"<tr><td>"+key+"</td><td>"+detected_lang_dict[key]+"</td></tr>" response = response+"</table> " else: response=response % "" return response - + def get_module_name(self): + return "Indian Language Detector" + def get_info(self): + return "Detects the language of the given text word by word. Supports only Indian Language" +def getInstance(): + return LangDetect() |