Пример #1
0
def run(key, altUrl='https://api.rosette.com/rest/v1/'):
    # Create an API instance
    api = API(user_key=key, service_url=altUrl)

    language_data = "Por favor Señorita, says the man."
    params = DocumentParameters()
    params["content"] = language_data
    api.set_custom_headers("X-RosetteAPI-App", "python-app")
    try:
        return api.language(params)
    except RosetteException as e:
        print(e)
Пример #2
0
def run(key, alt_url='https://api.rosette.com/rest/v1/'):
    """ Run the example """
    # Create an API instance
    api = API(user_key=key, service_url=alt_url)

    language_multilingual_data = "On Thursday, as protesters gathered in Washington D.C., the United States Federal Communications Commission under Chairman Ajit Pai voted 3-2 to overturn a 2015 decision, commonly called Net Neutrality, that forbade Internet service providers (ISPs) such as Verizon, Comcast, and AT&T from blocking individual websites or charging websites or customers more for faster load times.  Quatre femmes ont été nommées au Conseil de rédaction de la loi du Qatar. Jeudi, le décret royal du Qatar a annoncé que 28 nouveaux membres ont été nommés pour le Conseil de la Choura du pays.  ذكرت مصادر أمنية يونانية، أن 9 موقوفين من منظمة \"د هـ ك ب ج\" الذين كانت قد أوقفتهم الشرطة اليونانية في وقت سابق كانوا يخططون لاغتيال الرئيس التركي رجب طيب أردوغان."
    params = DocumentParameters()
    params["content"] = language_multilingual_data
    api.set_custom_headers("X-RosetteAPI-App", "python-app")
    api.set_option('multilingual', True)

    try:
        return api.language(params)
    except RosetteException as exception:
        print(exception)