Examples of MosesTranslation


Examples of it.celi.organic.lingua.moses.ws.xml.MosesTranslation

  @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
  public Response doGet(@QueryParam("text") String text, @QueryParam("langFrom") String langFrom, @QueryParam("langTo") String langTo,
      @DefaultValue("false") @QueryParam("JSONoutput") boolean jsonOutput)
  {
    String translation = MosesProxyServiceREST.mp.getTranslation(text.toLowerCase(), langFrom, langTo);
    MosesTranslation mt=null;
    if(translation==null)
      mt=new MosesTranslation(false, text);
    else 
      mt=new MosesTranslation(true, translation);
    if (!jsonOutput)
      return Response.ok(mt, MediaType.APPLICATION_XML).build();
    else
      return Response.ok(mt, MediaType.APPLICATION_JSON).build();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.