Exemplo n.º 1
0
def from_buffer(string, serverEndpoint=ServerEndpoint, xmlContent=False):
    if not xmlContent:
        status, response = callServer('put', serverEndpoint, '/rmeta/text', string,
                {'Accept': 'application/json'}, False)
    else:
        status, response = callServer('put', serverEndpoint, '/rmeta/xml', string,
                {'Accept': 'application/json'}, False)      
  
    return _parse((status,response))
Exemplo n.º 2
0
def from_buffer(string, serverEndpoint=ServerEndpoint, xmlContent=False):
    if not xmlContent:
        status, response = callServer('put', serverEndpoint, '/rmeta/text',
                                      string, {'Accept': 'application/json'},
                                      False)
    else:
        status, response = callServer('put', serverEndpoint, '/rmeta/xml',
                                      string, {'Accept': 'application/json'},
                                      False)

    return _parse((status, response))
Exemplo n.º 3
0
def from_buffer(string, srcLang, destLang, serverEndpoint=ServerEndpoint):
    status, response = callServer(
        "put",
        ServerEndpoint,
        "/translate/all/" + Translator + "/" + srcLang + "/" + destLang,
        string,
        {"Accept": "text/plain"},
        False,
    )
    return response
Exemplo n.º 4
0
def from_buffer(string, serverEndpoint=ServerEndpoint):
    status, response = callServer('put', serverEndpoint, '/rmeta', string,
                                  {'Accept': 'application/json'}, False)
    return _parse((status, response))
Exemplo n.º 5
0
def from_buffer(string):
    status, response = callServer('put', ServerEndpoint, '/detect/stream',
                                  string, {'Accept': 'text/plain'}, False)
    return response
Exemplo n.º 6
0
def from_buffer(string, serverEndpoint=ServerEndpoint):
    status, response = callServer('put', serverEndpoint, '/rmeta', string,
            {'Accept': 'application/json'}, False)
    return _parse((status,response))
Exemplo n.º 7
0
def auto_from_buffer(string, destLang, serverEndpoint=ServerEndpoint):
    status, response = callServer(
        'put', ServerEndpoint, '/translate/all/' + Translator + '/' + destLang,
        string, {'Accept': 'text/plain'}, False)
    return response
Exemplo n.º 8
0
def from_buffer(string):
    status, response = callServer('put', ServerEndpoint, '/detect/stream', string,
                                  {'Accept': 'text/plain'}, False)
    return response