Normalize¶
arapy.normalize.normalizer ¶
The Normalizer pipeline.
Normalizer
dataclass
¶
Apply rules in order. Frozen and callable, so it is itself a Rule.
Extend one with +: SEARCH + my_rule or SEARCH + other_normalizer.
arapy.normalize.presets ¶
Ready-made normalizers.
SEARCH
module-attribute
¶
SEARCH = Normalizer(
(
*_CLEAN,
fold_alef,
fold_alef_maqsura,
fold_teh_marbuta,
fold_hamza_carriers,
fold_digits,
collapse_spaces,
)
)
Loose matching for search: folds letters, hamza carriers and digits.
NAMES
module-attribute
¶
NAMES = Normalizer(
(
*_CLEAN,
fold_alef,
fold_alef_maqsura,
fold_teh_marbuta,
split_compound_names,
collapse_spaces,
)
)
Matching personal names: like SEARCH, but keeps hamza carriers and splits compound names.
SORT
module-attribute
¶
Cleanup before sorting. Letter folding for order happens in arapy.sort.
arapy.normalize.match ¶
Matching helpers built on normalizers.
arapy.normalize.rules ¶
Individual normalization rules. Each rule is a small, pure str -> str function.