sohaibafifi / languagetool

A fork of languagetool to maintain Arabic
https://languagetool.org
GNU Lesser General Public License v2.1
18 stars 1 forks source link

تنوين الفتح على الألف #56

Closed linuxscout closed 2 years ago

linuxscout commented 2 years ago

السلام عليكم هذه القاعدة لم تعمل، لأننا نحذف التشكيل،

التمثيل:

<rule id="spelling_error" name="تنوين النصب">
   <pattern>
      <marker>
         <token regexp="yes">.*اً</token>
      </marker>
   </pattern>
   <message>
      لأنه من الأخطاء الشائعة كتابة التنوين على الألف،
 والصحيح أن تُكتب على الحرف الذي قبل الألف؛ لأن التنوين نون ساكنة والألف ساكنة، فلا يجتمع ساكنان:
      <suggestion>
         <match no="1" regexp_match="اً" regexp_replace="ًا" />
      </suggestion>
   </message>
   <example correction="لبنًا" type="incorrect">
      شرب الطفل
      <marker>لبناً</marker>
   </example>
</rule>
linuxscout commented 2 years ago

Solved by XML rule:

<!ENTITY tanwin_fathatan "&#x064b;">
  <?xml version="1.0" encoding="UTF-8"?>
<rule id="spelling_error" name="تنوين النصب">
   <pattern>
      <marker>
         <token regexp="yes">.*ا&tanwin_fathatan;</token>
      </marker>
   </pattern>
   <message>
      لأنه من الأخطاء الشائعة كتابة التنوين على الألف، والصحيح أن تُكتب على الحرف الذي قبل الألف؛ لأن التنوين نون ساكنة والألف ساكنة، فلا يجتمع ساكنان
:
      <suggestion>
         <match no="1" regexp_match="ا(&tanwin_fathatan;)?$" regexp_replace="ً&tanwin_fathatan;ا" />
      </suggestion>
   </message>
   <example correction="لبنًا" type="incorrect">
      شرب الطفل
      <marker>لبناً</marker>
   </example>
</rule>