From 768bba123c223fec4ca3374aafc7e0f9bb631985 Mon Sep 17 00:00:00 2001 From: Balasankar C Date: Fri, 8 Sep 2017 00:16:21 +0530 Subject: [PATCH 1/4] Add libindic namespace to the modules --- silpa/api/jsonrpc.py | 1 + silpa/frontend/__init__.py | 1 + silpa/helper.py | 1 + 3 files changed, 3 insertions(+) diff --git a/silpa/api/jsonrpc.py b/silpa/api/jsonrpc.py index 6f72420..fafb35f 100644 --- a/silpa/api/jsonrpc.py +++ b/silpa/api/jsonrpc.py @@ -91,6 +91,7 @@ def __init__(self, data): def __call__(self): # process request here module, method = self.request.method.split('.') + module = "libindic." + module if module not in sys.modules: # Module is not yet loaded or the request module is not # enabled pass an error here. diff --git a/silpa/frontend/__init__.py b/silpa/frontend/__init__.py index 7ab17ef..696a81d 100644 --- a/silpa/frontend/__init__.py +++ b/silpa/frontend/__init__.py @@ -16,5 +16,6 @@ def load_module_templates(app): modules = ModuleConfigHelper.get_modules() templates = [app.jinja_loader] for module in modules: + module = "libindic." + module templates.append(PackageLoader(module)) app.jinja_loader = ChoiceLoader(templates) diff --git a/silpa/helper.py b/silpa/helper.py index e77da81..cdf0f9e 100644 --- a/silpa/helper.py +++ b/silpa/helper.py @@ -35,6 +35,7 @@ def get_baseurl(cls): @classmethod def load_modules(cls): for module in cls.module_names: + module = "libindic." + module try: importlib.import_module(module) except ImportError as e: From dab790f80ee182a7fe9cf42631142d6b4978b4ad Mon Sep 17 00:00:00 2001 From: Balasankar C Date: Fri, 8 Sep 2017 13:00:19 +0530 Subject: [PATCH 2/4] Use correct path for modules --- etc/silpa.conf | 28 +++++++++++++++------------- requirements-modules.txt | 38 +++++++++++++++++++------------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/etc/silpa.conf b/etc/silpa.conf index d33036e..d2eee5a 100644 --- a/etc/silpa.conf +++ b/etc/silpa.conf @@ -23,20 +23,21 @@ log_name = silpa.log # These section provides list of modules use # 'yes' to enable them and 'no' to disable spellchecker = no -inexactsearch = no +inexactsearch = yes soundex = yes transliteration = no -hyphenation = no -chardetails = no -payyans = no -indicsyllabifier = no -indicfortune = no -ucasort = no -indicngram = no -shingling = no +hyphenation = yes +guesslanguage = yes +chardetails = yes +payyans = yes +syllabifier = yes +fortune = yes +ucasort = yes +ngram = yes +shingling = yes textsimilarity = no indicstemmer = no -katapayadi = no +katapayadi = yes #scriptrender = yes [module_display] @@ -49,12 +50,13 @@ transliteration = Transliteration hyphenation = Hyphenate chardetails = Chardetails payyans = Payyans -indicsyllabifier = Syllabalizer -indicfortune = Fortune +syllabifier = Syllabifier +fortune = Fortune ucasort = UCA Sort -indicngram = N-gram +ngram = N-gram shingling = Shingling textsimilarity = Similar Texts indicstemmer = Stemmer katapayadi = Katapayadi Numbers scriptrender = Script Render +guesslanguage = Guess Language diff --git a/requirements-modules.txt b/requirements-modules.txt index f40ff27..f2abec0 100644 --- a/requirements-modules.txt +++ b/requirements-modules.txt @@ -1,19 +1,19 @@ --e git+https://github.com/Project-SILPA/Transliteration.git#egg=transliteration --e git+https://github.com/Project-SILPA/text-similarity.git#egg=textsimilarity --e git+https://github.com/Project-SILPA/ucasort.git#egg=ucasort --e git+https://github.com/Project-SILPA/spellchecker.git#egg=spellchecker --e git+https://github.com/Project-SILPA/Soundex.git@development#egg=soundex --e git+https://github.com/Project-SILPA/silpa-common.git#egg=silpa_common --e git+https://github.com/Project-SILPA/shingling.git#egg=shingling -#-e git+https://github.com/Project-SILPA/scriptrender.git#egg=scriptrender --e git+https://github.com/Project-SILPA/payyans.git#egg=payyans --e git+https://github.com/Project-SILPA/normalizer.git#egg=normalizer --e git+https://github.com/Project-SILPA/inexactsearch.git#egg=inexactsearch --e git+https://github.com/Project-SILPA/syllabalizer.git#egg=indicsyllabifier --e git+https://github.com/Project-SILPA/indicngram.git#egg=indicngram --e git+https://github.com/Project-SILPA/indicfortune.git#egg=indicfortune --e git+https://github.com/Project-SILPA/Hyphenation.git#egg=hyphenation --e git+https://github.com/Project-SILPA/guesslanguage.git#egg=guesslanguage --e git+https://github.com/Project-SILPA/chardetails.git#egg=chardetails --e git+https://github.com/Project-SILPA/katapayadi.git#egg=katapayadi --e git+https://github.com/Project-SILPA/indicstemmer.git#egg=indicstemmer +#-e git+https://github.com/libindic/Transliteration.git#egg=transliteration +#-e git+https://github.com/libindic/indicstemmer.git#egg=indicstemmer +#-e git+https://github.com/libindic/scriptrender.git#egg=scriptrender +#-e git+https://github.com/libindic/silpa-common.git#egg=silpa_common +#-e git+https://github.com/libindic/spellchecker.git#egg=spellchecker +#-e git+https://github.com/libindic/text-similarity.git#egg=textsimilarity +-e git+https://github.com/libindic/Hyphenation.git@development#egg=libindic_hyphenation +-e git+https://github.com/libindic/Soundex.git@namespaced-development#egg=libindic_soundex +-e git+https://github.com/libindic/chardetails.git@development#egg=libindic_chardetails +-e git+https://github.com/libindic/guesslanguage.git@development#egg=libindic_guesslanguage +-e git+https://github.com/libindic/indicfortune.git@development#egg=libindic_fortune +-e git+https://github.com/libindic/indicngram.git@development#egg=libindic_ngram +-e git+https://github.com/libindic/inexactsearch.git@development#egg=libindic_inexactsearch +-e git+https://github.com/libindic/katapayadi.git@development#egg=libindic_katapayadi +-e git+https://github.com/libindic/normalizer.git#egg=libindic_normalizer +-e git+https://github.com/libindic/payyans.git@development#egg=libindic_payyans +-e git+https://github.com/libindic/shingling.git@development#egg=libindic_shingling +-e git+https://github.com/libindic/syllabalizer.git@development#egg=libindic-syllabifier +-e git+https://github.com/libindic/ucasort.git@development#egg=libindic_ucasort From ec4320cca7f68cad8660d6813c9713fe21d0f9f3 Mon Sep 17 00:00:00 2001 From: Balasankar C Date: Fri, 8 Sep 2017 13:00:45 +0530 Subject: [PATCH 3/4] Enhance gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 6c70b22..2a2345e 100755 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,7 @@ venv *silpa.min.* /.testrepository/ /cover/ + +env/ +src/ +.eggs/ From 90bb2ddce53edc5f497002f36c5e8a8bb84a610e Mon Sep 17 00:00:00 2001 From: Balasankar C Date: Fri, 8 Sep 2017 14:50:59 +0530 Subject: [PATCH 4/4] Add stemmer --- etc/silpa.conf | 4 ++-- requirements-modules.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/silpa.conf b/etc/silpa.conf index d2eee5a..195f3db 100644 --- a/etc/silpa.conf +++ b/etc/silpa.conf @@ -36,7 +36,7 @@ ucasort = yes ngram = yes shingling = yes textsimilarity = no -indicstemmer = no +stemmer = yes katapayadi = yes #scriptrender = yes @@ -56,7 +56,7 @@ ucasort = UCA Sort ngram = N-gram shingling = Shingling textsimilarity = Similar Texts -indicstemmer = Stemmer +stemmer = Stemmer katapayadi = Katapayadi Numbers scriptrender = Script Render guesslanguage = Guess Language diff --git a/requirements-modules.txt b/requirements-modules.txt index f2abec0..b0fdda4 100644 --- a/requirements-modules.txt +++ b/requirements-modules.txt @@ -1,5 +1,4 @@ #-e git+https://github.com/libindic/Transliteration.git#egg=transliteration -#-e git+https://github.com/libindic/indicstemmer.git#egg=indicstemmer #-e git+https://github.com/libindic/scriptrender.git#egg=scriptrender #-e git+https://github.com/libindic/silpa-common.git#egg=silpa_common #-e git+https://github.com/libindic/spellchecker.git#egg=spellchecker @@ -10,6 +9,7 @@ -e git+https://github.com/libindic/guesslanguage.git@development#egg=libindic_guesslanguage -e git+https://github.com/libindic/indicfortune.git@development#egg=libindic_fortune -e git+https://github.com/libindic/indicngram.git@development#egg=libindic_ngram +-e git+https://github.com/libindic/indicstemmer.git@development#egg=libindic_stemmer -e git+https://github.com/libindic/inexactsearch.git@development#egg=libindic_inexactsearch -e git+https://github.com/libindic/katapayadi.git@development#egg=libindic_katapayadi -e git+https://github.com/libindic/normalizer.git#egg=libindic_normalizer