Back to LanguageTool Homepage - Privacy - Imprint

[ar] generate multiple suggestions

Hi,
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

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

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 (http://wiki.languagetool.org/development-overview#toc20).

Thanks,
I reformulate my question:

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

You can do that like in this example:

<rule id="ELUDED_TO" name="eluded to (alluded to)">
    <pattern>
       <token inflected="yes">elude</token>
       <token>to</token>
    </pattern>
    <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>
</rule>

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

<rule id="bldmn" name="bld mn (blad mn)">
    <pattern>
       <token inflected="yes">blad</token>
       <token>mn</token>
    </pattern>
    <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>
</rule>

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.
Thanks.

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

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

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