Commit 6c1479b8b7a08d7a48586b0bf01403a94035320c

Authored by Killian
1 parent b3cdd2e747
Exists in soap

Modification Orkis

Showing 2 changed files with 23 additions and 1 deletions Side-by-side Diff

... ... @@ -34,5 +34,16 @@
34 34 self.clean()
35 35 self.insertLem()
36 36 self.insertPhon()
37   - return self.dico
  37 + table=[]
  38 + for i in self.dico:
  39 + if not i == "<s>":
  40 + list=[]
  41 + list.append(i)
  42 + for indice in self.dico[i][0]:
  43 + list.append(indice)
  44 + for indice in self.dico[i][1]:
  45 + list.append(indice)
  46 + ligne= " ".join(list)
  47 + table.append(ligne)
  48 + return "\n".join(table)
... ... @@ -5,7 +5,10 @@
5 5 from flask import Flask, request, render_template
6 6 from processor.LiaTools import *
7 7 from processor.Orkis import Orkis
  8 +from flaskext.enterprise import Enterprise
  9 +
8 10 app = Flask(__name__)
  11 +enterprise = Enterprise(app)
9 12  
10 13 @app.route("/")
11 14 def docs():
... ... @@ -22,6 +25,14 @@
22 25 taggedTable= orkisProc.getDico()
23 26 # Returning a row text to be parse client side
24 27 return unicode(taggedTable)
  28 +
  29 +class OrkisService(enterprise.SOAPService):
  30 + @enterprise.soap(enterprise.String,_returns=enterprise._sp.String)
  31 + def get_phon(self,string):
  32 + orkisProc=Orkis(string)
  33 + return orkisProc.getDico()
  34 +
  35 +
25 36 if __name__ == '__main__':
26 37 app.debug = True
27 38 app.run(host='0.0.0.0')