Commit ·
5dfa9cd
1
Parent(s): 638b53d
Revert FIX-42c: Grammar feminine ending guard was too aggressive
Browse filesFIX-42c blocked valid gender agreement corrections like:
- الصغيره→الصغير (masculine adjective agreement) — PC036 regressed
- القديمه→القديم (masculine adjective agreement) — PC048 regressed
Keeping FIX-42a (length ratio), FIX-42b (first-letter), FIX-42d (trailing ا).
Tests: 39 passing.
- src/app.py +2 -13
src/app.py
CHANGED
|
@@ -2131,19 +2131,8 @@ def analyze_text():
|
|
| 2131 |
)
|
| 2132 |
continue
|
| 2133 |
|
| 2134 |
-
|
| 2135 |
-
|
| 2136 |
-
# Catches: المديره→المدير, للطالبه→للطالب
|
| 2137 |
-
if orig_text and corr_text:
|
| 2138 |
-
_o_g = orig_text.rstrip('.،؛؟!?!')
|
| 2139 |
-
_c_g = corr_text.rstrip('.،؛؟!?!')
|
| 2140 |
-
if (_o_g.endswith(('ه', 'ة')) and not _c_g.endswith(('ه', 'ة'))
|
| 2141 |
-
and (_c_g == _o_g[:-1] or len(_c_g) < len(_o_g))):
|
| 2142 |
-
logger.info(
|
| 2143 |
-
f"[GRAMMAR] Blocked feminine ending strip: "
|
| 2144 |
-
f"'{orig_text}'→'{corr_text}'"
|
| 2145 |
-
)
|
| 2146 |
-
continue
|
| 2147 |
|
| 2148 |
|
| 2149 |
|
|
|
|
| 2131 |
)
|
| 2132 |
continue
|
| 2133 |
|
| 2134 |
+
|
| 2135 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2136 |
|
| 2137 |
|
| 2138 |
|