Back to LanguageTool Homepage - Privacy - Imprint

Bitext rules and Regexp


(Fred Giannetti) #1

Hello!

The current format for bitext rules does not implement the regexp element. Is this a part of your roadmap or is there any deeper reason preventing this from happening?


(Daniel Naber) #2

There's no specific reason I can think of other than a lack of time and the fact that both features (bitext and <regexp>) are quite specific and their combination is even more specific.


(Fred Giannetti) #3

Thanks for answering so swiftly.

I wanted to use bitext rules to check the consistency of typographical elements between aligned text hence regexes.


(Daniel Naber) #4

Note that you can still use regexp on a token level, e.g. this will match a token that's a digit:

<pattern>
  <token regexp="yes">\d</token>
</pattern>

(Fred Giannetti) #5

Indeed, that solves some problems :slight_smile:

But for some loose patterns where the number of tokens is not necessarily constant, I haven't found a workaround so far.