Back to LanguageTool Homepage - Privacy - Imprint

[ar] generate multiple suggestions

I want to generate suggestion for this case:
I have word like Aqlà => Intlq (in arabic أقلع to انطلق),
due to the rich morphology, this example needs suggestions like this

    if Aqlà:
    suggests: intlq
    if tqlà: suggests tntlq
    if yqlà: suggests yntlq
    if nqlà: suggests nntlq

I tried to generate suggestions like this

   <token inflected="yes">Aqlà</token>
  <suggestion><match no='1' regexp_match="Aqlà" regexp_replace="intlq"/></suggestion>
  <suggestion><match no='1' regexp_match="qlà" regexp_replace="ntlq"/></suggestion>
 <example correction="intlq" type="incorrect"><marker>Aqlà</marker> word </example>
 <example correction="yntlq" type="incorrect"><marker>yqlà</marker> word </example>

But it generates unsuitable suggestions.
can you help me?

Do you really want to replace one word with one other word, not considering context? Or was this just an example? Are these words (tqlà, yqlà, …) forms of Aqlà?

I simplify the example to explain how to problem occurs.

yes, as prefixes t-qlà, y-qlà for A-qlà.

I might be missing something, but I think you need a <filter> for these cases, i.e. Java programming is required (

I reformulate my question:

  • How can I replace a ‘verb1’ by a verb ‘verb2’ with the same postag for the conjugated form.

You can do that like in this example:

<rule id="ELUDED_TO" name="eluded to (alluded to)">
       <token inflected="yes">elude</token>
    <message>Did you mean <suggestion><match no="1" postag="VB.*">allude</match> to</suggestion>?</message>
    <example correction="alluded to">He <marker>eluded to</marker> engagement at the party.</example>

I tried this example, I make one with arabic words,

<rule id="bldmn" name="bld mn (blad mn)">
       <token inflected="yes">blad</token>
    <message>Did you mean <suggestion><match no="1" postag="N.*">bld</match> mn</suggestion>?</message>
    <example correction="bld mn"> <marker>blad mn</marker>.</example>
    <example correction="albld mn"><marker>alblad mn</marker>.</example>

by testing this example I had :

Incorrect suggestions: bld mn != (bld) mn on input: He blad mn engagement at the party.)
 Incorrect suggestions: albld mn != (bld) mn on input: He alblad mn engagement at the part

Is there any configuration or module to activate, please note that we have an arabic_synth.dict file.

N.B. The given examples are transliterated from Arabic, the original is:

       <token inflected="yes">بلاد</token>
    <message>Did you mean <suggestion><match no="1" postag="N.*">بلد</match> من</suggestion>?</message>
    <example correction="بلد من"> <marker>بلاد من</marker>.</example>
    <example correction="البلد من"><marker>البلاد من</marker></example>
Incorrect suggestions: بلد من != (بلد) من on input: He بلاد من engagement at the party.)
 Incorrect suggestions: البلد من != (بلد) من on input: He البلاد من engagement at the part

I found an error on arabic_tags.txt file,
it must contain all possible postags.