@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response doGetAligned(@QueryParam("text") String text, @QueryParam("langFrom") String langFrom, @QueryParam("langTo") String langTo,
@DefaultValue("false") @QueryParam("JSONoutput") boolean jsonOutput)
{
List<AlignedTranslation> translation = MosesProxyServiceREST.mp.getAlignedTranslation(text.toLowerCase(), langFrom, langTo);
MosesAlignedTranslation mt=null;
if(translation==null)
mt=new MosesAlignedTranslation(false, null);
else
mt=new MosesAlignedTranslation(true, translation);
if (!jsonOutput)
return Response.ok(mt, MediaType.APPLICATION_XML).build();
else
return Response.ok(mt, MediaType.APPLICATION_JSON).build();
}