From 6c1479b8b7a08d7a48586b0bf01403a94035320c Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 5 Jun 2013 17:29:57 +0200 Subject: [PATCH] Modification Orkis --- processor/Orkis.py | 13 ++++++++++++- webtagger.py | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/processor/Orkis.py b/processor/Orkis.py index bd5131d..aabd84a 100644 --- a/processor/Orkis.py +++ b/processor/Orkis.py @@ -34,4 +34,15 @@ class Orkis(baseProcessor): self.clean() self.insertLem() self.insertPhon() - return self.dico + table=[] + for i in self.dico: + if not i == "": + list=[] + list.append(i) + for indice in self.dico[i][0]: + list.append(indice) + for indice in self.dico[i][1]: + list.append(indice) + ligne= " ".join(list) + table.append(ligne) + return "\n".join(table) diff --git a/webtagger.py b/webtagger.py index ffc085e..836367f 100644 --- a/webtagger.py +++ b/webtagger.py @@ -5,7 +5,10 @@ import json from flask import Flask, request, render_template from processor.LiaTools import * from processor.Orkis import Orkis +from flaskext.enterprise import Enterprise + app = Flask(__name__) +enterprise = Enterprise(app) @app.route("/") def docs(): @@ -22,6 +25,14 @@ def cleaner(): taggedTable= orkisProc.getDico() # Returning a row text to be parse client side return unicode(taggedTable) + +class OrkisService(enterprise.SOAPService): + @enterprise.soap(enterprise.String,_returns=enterprise._sp.String) + def get_phon(self,string): + orkisProc=Orkis(string) + return orkisProc.getDico() + + if __name__ == '__main__': app.debug = True app.run(host='0.0.0.0') -- 1.8.2.3