Reading a page: “up to” is only looked for before the figure, and the whole-word guard matches inside Hindi and Bengali words #1106
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#1106
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while reviewing the Hindi, Urdu and Bengali translations of the builtin plugin's keyword lists (2026-10-30). The page reader in
src/postulo/plugins/builtin/patterns.py(#267) cannot work for these languages as written, for two reasons. Translating the lists does not fix either.1. "Up to" is only looked for before the figure
UP_TO_WORDS("up to|maximum|max") is searched only in the text before the figure:beforeat line 578,fillerat line 608. Languages with postpositions put the word after the number:On such a page, "up to 40,000" is read as a minimum of 40,000, which is the opposite of what the advert says. The translators of hi, ur and bn marked these lines unsure for this reason.
RANGE_WORDShas the same shape: "30,000 से 40,000 तक" works only because से happens to sit between the figures.2. The whole-word guard fails inside Indic words
_word()(line 236) wraps each spelling in(?<![^\W\d_])…(?![^\W\d_]). Python's\wdoes not count combining vowel signs (matras: U+093E ा, U+0947 े, U+0948 ै, U+093F ि, U+0902 ं, U+094D ्…) as word characters. So a spelling that starts or ends next to a matra is matched in the middle of a word:This affects every list read through
_word(): closing words, salary words and periods, not only pay ranges. It also hits every script that uses combining marks: Devanagari, Bengali, Gurmukhi, Tamil, Thai, and Arabic with harakat.What to do
UP_TO_WORDS, and the same for the closing word of a range. That keeps the lists translatable without code per language.(?<![\w\p{M}])with theregexmodule, or checkunicodedata.category(ch)[0] in "LMN"around the match.Not a 0.5.0 blocker: a page in these languages is still read in English as well, and nothing is invented. But hi, ur and bn are selected for 0.5, so their lists will be wrong until this lands.