# Path: grafeno/pipeline.py
# DEF_PARSER = 'spacy'
# DEF_TRANSFORMERS = ['all']
# DEF_T_ARGS = {}
# DEF_LINEARIZERS = []
# DEF_L_ARGS = {}
#             T = transformers.get_pipeline(ts)
#             L = linearizers.get_pipeline(pipeline.get('linearizers', DEF_LINEARIZERS))
# def run (pipeline):


import argparse
import bottle
import json
import re
import unicodedata
import yaml
import collections
from bottle import static_file, abort, error, get, post, request, run, view
from grafeno import pipeline
from nltk.corpus import wordnet as wn
    return control_char_re.sub(' ', s)

def run_pipeline (config):
    try:
        result = pipeline.run(config)
    except ValueError as e:
        abort(400,str(e))
    try:
        j = result.to_json()
        result = json.loads(j)
    except AttributeError:
        pass
    bottle.response.content_type = 'application/json'
    return json.dumps({
        'ok': True,
        'result': result
        })

def dict_merge (x, y):
    for key, val in y.items():
        if isinstance(val, collections.Mapping):
            r = dict_merge(x.get(key, {}), val)
            x[key] = r
        else:
            x[key] = y[key]
    return x

# ROUTES

@post('/raw')

# Path: grafeno/pipeline.py
# DEF_PARSER = 'spacy'
# DEF_TRANSFORMERS = ['all']
# DEF_T_ARGS = {}
# DEF_LINEARIZERS = []
# DEF_L_ARGS = {}
#             T = transformers.get_pipeline(ts)
#             L = linearizers.get_pipeline(pipeline.get('linearizers', DEF_LINEARIZERS))
# def run (pipeline):


# Path: server.py
import argparse
import bottle
import json
import re
import unicodedata
import yaml
import collections
from bottle import static_file, abort, error, get, post, request, run, view
from grafeno import pipeline
from nltk.corpus import wordnet as wn

    return control_char_re.sub(' ', s)

def run_pipeline (config):
    try:
        result = pipeline.run(config)
    except ValueError as e:
        abort(400,str(e))
    try:
        j = result.to_json()
        result = json.loads(j)
    except AttributeError:
        pass
    bottle.response.content_type = 'application/json'
    return json.dumps({
        'ok': True,
        'result': result
        })

def dict_merge (x, y):
    for key, val in y.items():
        if isinstance(val, collections.Mapping):
            r = dict_merge(x.get(key, {}), val)
            x[key] = r
        else:
            x[key] = y[key]
    return x

# ROUTES

@post('/raw')

def raw_request():