From 9aab1de7383750179acc696485ad651e5c2b4bb2 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 7 Jun 2013 17:12:24 +0200 Subject: [PATCH] Tentative Soap infructueuse --- processor/Orkis.py | 12 ++++++++++++ webtagger.py | 11 +++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/processor/Orkis.py b/processor/Orkis.py index aabd84a..3efb025 100644 --- a/processor/Orkis.py +++ b/processor/Orkis.py @@ -11,6 +11,18 @@ class Orkis(baseProcessor): def isReady(self): self.phoner.isReady() self.tagger.isReady() + def __str__(self): + string="" + for word in self.dico: + string += (word+';') + for lemWord in self.dico[word][0]: + string += (lemWord+" ") + string +=";" + for phonWord in self.dico[word][1]: + string += (phonWord+" ") + string += ';' + string+='\n' + return string def clean(self): stopword=StopWord() self.string=stopword.RemoveStopList(self.string) diff --git a/webtagger.py b/webtagger.py index 836367f..0bb4b52 100644 --- a/webtagger.py +++ b/webtagger.py @@ -2,11 +2,12 @@ import subprocess import os import json +from lxml import etree from flask import Flask, request, render_template from processor.LiaTools import * from processor.Orkis import Orkis from flaskext.enterprise import Enterprise - +from time import ctime app = Flask(__name__) enterprise = Enterprise(app) @@ -27,11 +28,9 @@ def cleaner(): 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() - + @enterprise.soap(returns=enterprise._sp.String) + def get_phon(self): + return ctime() if __name__ == '__main__': app.debug = True -- 1.8.2.3