MAHMOUD ABDELNABY
Localization · CLI SCRIPT · 2

Arabic Number Formatting & BiDi Text Normalization Linter

Eliminate scrambled phone numbers, flipped percentages, and mixed numerals on Arabic web pages with automated BiDi normalization.

Problem it addresses

Develop a pure Python Arabic numeral and bidirectional text normalization CLI (bidi_linter.py): 1) Scans text and HTML files for mixed Western/Eastern numerals, 2) Automates one-click normalization to either system, 3) Detects phone numbers and currency strings that lack proper <bdi> or Unicode RLM/LRM isolation marks, 4) Outputs a clean terminal report and corrected text files.

Who it is for

BOTH operating in high-growth e-commerce, digital publishing, and direct-response marketing across Saudi Arabia, UAE, and Egypt.

What is inside

Key files listed in the README repository architecture:

  • docs/unicode-bidi-best-practices.md
  • examples/scrambled_and_fixed_text.html
  • LICENSE
  • README.md
  • src/bidi_linter.py
  • tests/test_bidi.py
  • tools/web_normalizer.html

How to evaluate and use it

  1. Read the README first and confirm that the documented problem matches your use case.
  2. Inspect the listed files to find the data, tools, templates, and tests relevant to your task.
  3. Follow the repository’s Quick Start and check prerequisites before running commands.
  4. Compare outputs with documented examples and review limitations before using them in a decision or client workflow.

Quick Start from the README: python -m unittest discover -s tests · python src/bidi_linter.py --help

Scope and limitations

  • Eastern Arabic (٠-٩) vs Western Arabic (0-9) Digits: Enforces numeral consistency within regional markets (Saudi retail predominantly Western 0-9).
  • BiDi Formatting Characters: Injects Unicode Left-to-Right Mark (&lrm; / U+200E) around telephone numbers and prices to prevent displaced currency symbols.
  • Mathematical Operator Placement: Preserves proper visual ordering for percentages (e.g. 50%) and mathematical ranges within RTL sentences.

This page summarizes the available documentation; it does not establish performance or business results. Verify data and prerequisites before use.

Related repositories