summaryrefslogtreecommitdiffstats
path: root/silpa/utils/langdetect.py
diff options
context:
space:
mode:
authorSanthosh Thottingal <santhosh.thottingal@gmail.com>2009-05-24 13:04:44 +0530
committerSanthosh Thottingal <santhosh.thottingal@gmail.com>2009-05-24 13:04:44 +0530
commit30c1b89bec818490131780389c918f8bcfb7aef6 (patch)
treed0a5b076a8781247932e7b507124705f9f3e2f03 /silpa/utils/langdetect.py
parent5a2dfd79178371a529053795d90b48dd96421d88 (diff)
downloadRachana.git-30c1b89bec818490131780389c918f8bcfb7aef6.tar.gz
Rachana.git-30c1b89bec818490131780389c918f8bcfb7aef6.tar.xz
Rachana.git-30c1b89bec818490131780389c918f8bcfb7aef6.zip
Miscellaneous bug fixes, hit counter, static pages
Diffstat (limited to 'silpa/utils/langdetect.py')
-rw-r--r--silpa/utils/langdetect.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/silpa/utils/langdetect.py b/silpa/utils/langdetect.py
index 727ea6d..2ed7c6f 100644
--- a/silpa/utils/langdetect.py
+++ b/silpa/utils/langdetect.py
@@ -21,27 +21,39 @@ class LangDetect(SilpaModule):
index = 0
while index < length:
letter=word[index]
+ if not letter.isalpha():
+ index=index+1
+ continue
if ((letter >= u'ം') & (letter <=u'൯')):
result_dict[word]= "ml_IN"
+ break;
if ((letter >= u'ঁ') & (letter <= u'৺')):
result_dict[word]= "bn_IN"
+ break
if ((letter >= u'ँ') & (letter <= u'ॿ')):
result_dict[word]= "hi_IN"
+ break
if ((letter >=u'ઁ') & (letter <= u'૱')):
result_dict[word]= "gu_IN"
+ break
if ((letter >= u'ਁ') & (letter <=u'ੴ')):
result_dict[word]= "pa_IN"
+ break
if ((letter >= u'ಂ') & (letter <=u'ೲ')):
- result_dict[word]= "ka_IN"
+ result_dict[word]= "kn_IN"
+ break
if ((letter >= u'ଁ') & (letter <= u'ୱ')):
result_dict[word]= "or_IN"
+ break
if ((letter >=u'ஂ') & (letter <= u'௺')):
result_dict[word]= "ta_IN"
+ break
if ((letter >=u'ఁ') & (letter <= u'౯')):
result_dict[word]= "te_IN"
+ break
if ((letter <= u'z')):
result_dict[word]= "en_US"
-
+ break
index=index+1
word_iter=word_iter+1
return result_dict