Back to LanguageTool Homepage - Privacy - Imprint

Writing regular expressions for tokens


(Praneet Khandelwal) #1

I wanted to repeat certain sequence of tokens.For eg:

    <token postag="JJ|NN:.*" postag_regexp="yes" min="0" max="5">
    <token postag="CC" min="0"/>

Both this token need to repeated together. Is there any way it is supported in the LT?


(Daniel Naber) #2

Unfortunately not. For this, we'd need a real regex engine for tokens, and we don't have that.


(Praneet Khandelwal) #3

Thanks for the information.


(Andriy) #4

Note: you can write Java rules in LT - any logic is possible there.


(Praneet Khandelwal) #5

Till now, I had only been adding grammar rules in a separate xml file. Can you guide or refer me to the process for where and how to add JAVA rules (also what commands to run for compiling them)?


(Andriy) #6

I would start here http://wiki.languagetool.org/development-overview#toc19