Blame view

liaRest.py 956 Bytes
dcdaad1b0   Killian   passage en soap :...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  # -*- coding: utf-8 -*- 
  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)
  
  @app.route("/")
  def docs():
      return render_template('index.html')
  
  @app.route("/tagger",methods=['POST'])
  def cleaner():
      # Receive String from post parametre Raw text
      dirtyString= request.values[u'string']
      # Charging Processor et check if they are okay ( aim is to dynamic charge later ) 
      orkisProc = Orkis(dirtyString)
      # Processing 
      # Adding lemm of each words cause we went ther phonem too
      taggedTable= orkisProc.getDico()
      # Returning a row text to be parse client side
      return unicode(taggedTable)
dcdaad1b0   Killian   passage en soap :...
29
30
  if __name__ == '__main__':
      app.debug = True
b65eb4cd1   Killian   ajout des port Or...
31
      app.run(host='192.168.75.140',port=9001)