> The reason the expressions are precompiled is that --- as far as I
> recall --- it saved something like a third of time when translating
> short segments (e.g. one sentence or so).

I expected as such, thanks.

> It would be worth checking if this is still the case (pcre compilation
> was introduced several years ago, and the code and machines might be
> faster by now).

I've run apertium on my mobile phone (OpenMoko FreeRunner) and I can
tell you some machines are still very slow. I definitely wouldn't want
it to get slower there.

> Could compiling the transfer files be a post-install hook in the Debian
> packaging ?

post-install would only run when installing/upgrading apertium,
instead you would want something that would run when pcre3 is
upgraded. dpkg triggers would do that, but they would be run on every
machine with apertium installed instead of just on the Debian build
machines, which is a bit wasteful.

I would suggest this is the right solution:

apertium language packages should contain:

* pcre3 compiled regex format version number or equivalent
* compiled regexes
* normal regexes

The apertium translation engine should check if the version from the
language package and the runtime pcre3 library are the same and fall
back on compiling the normal regexes at runtime. This would be slower
but would prevent crashes.

The apertium translation UI should have a warning when there are
mis-matched versions so that distributions who aren't aware of this
issue get a warning.

The Debian pcre3 package should provide the pcre3 compiled regex
format version number and the Debian apertium language packages should
depend on that.

Debian should rebuild the apertium language packages during pcre3 transitions.

Do you know if there is any such thing as a "pcre3 compiled regex
format version number"? If there isn't, the a hash of the data output
by the compilation process on a specific regex might be an appropriate
substitute.

-- 
bye,
pabs

http://bonedaddy.net/pabs3/

------------------------------------------------------------------------------
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to