2015-06-09 13:27 GMT+02:00 Kevin Brubeck Unhammer <[email protected]>:

> Daniel Torregrosa <[email protected]> writes:
>
> > 2015-06-09 11:25 GMT+02:00 Kevin Brubeck Unhammer
> > <[email protected]>:
> >
> >     You could of course add your own separator
> >
> > Is there one that is guaranteed to work? 3 years ago tried many
> > different separators, and most of them didn't reliability work. I
> > settled with "\n\n\n", that looked fine for the language pairs I was
> > trying, but I think its far from reliable.
>
> APY uses the html deformatters, so you could use <apertium-notrans>,
> which would even let you put sentence id's in there if you feel like it.
>
> It'd probably be a good idea to also prepend a "<br>" tag (no slash),
> which makes the deformatter put a dot in there, hopefully ensuring no
> transfer rules move words in front of or after the separator.
>
> For example:
>     $ curl -s 
> "http://apy.projectjj.com/translate?langpair=cym|eng&q=<br><apertium-notrans>Brawddeg+1</apertium-notrans>Etifeddodd+Owain+y+rhan+fwyaf+o'r+deyrnas+ar+farwolaeth+Gruffudd+yn+1137.<br><apertium-notrans>Brawddeg+2</apertium-notrans>Erbyn+tua+1118+yr+oedd+Gruffudd+yn+rhy+hen+i+arwain+mewn+rhyfel+ei+hun<br><apertium-notrans>Brawddeg+3</apertium-notrans>et+cetera"|jq
> .responseData.translatedText
>     "<br><apertium-notrans>Brawddeg 1</apertium-notrans>Owain Inherited
> the biggest part of the  *deyrnas on a death *Gruffudd in
> 1137.<br><apertium-notrans>Brawddeg 2</apertium-notrans>By towards 1118
> was  *Gruffudd too old to lead  in war itself<br><apertium-notrans>Brawddeg
> 3</apertium-notrans>*et *cetera"
>
>
> > Null flush mode (-z parameter, I don't know if it is the correct name)
> > was not totally implemented back then, so maybe I can use that
> > locally. But I think APY does not support it.
>
> Yeah I wouldn't send a literal \0 in with the APY request, since it has
> special meaning in the pipeline. Behaviour undefined :)
>
>
My point is that you can send multiple calls without having a performance
cost (related to loading language data, you would still have the network
overhead). I though Dani was considering to use APY locally but he thought
it was not supporting null flush mode.

-- 
< Xavi Ivars >
< http://xavi.ivars.me >
------------------------------------------------------------------------------
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to