{
  "slug": "persian-text-normalizer",
  "name": "gizza-ai/persian-text-normalizer",
  "version": "0.1.0",
  "title": "Persian Text Normalizer — fix ZWNJ half-spaces, Arabic characters, digits — gizza.ai",
  "description": "Normalize Persian/Farsi text: replace Arabic letters, fix ZWNJ half-spaces, convert digits, and correct punctuation spacing in your browser.",
  "tags": [
    "persian text normalizer",
    "farsi normalizer",
    "zwnj",
    "half-space",
    "نیم‌فاصله",
    "arabic to persian characters",
    "persian digits",
    "virastar"
  ],
  "category": "text",
  "urls": {
    "page": "https://gizza.ai/tools/persian-text-normalizer/",
    "markdown": "https://gizza.ai/tools/persian-text-normalizer/index.md",
    "descriptor": "https://gizza.ai/tools/persian-text-normalizer/tool.json",
    "deep_link_example": "https://gizza.ai/tools/persian-text-normalizer/?text=%D9%85%D8%AA%D9%86%20%D9%81%D8%A7%D8%B1%D8%B3%DB%8C%20%D8%B1%D8%A7%20%D8%A7%DB%8C%D9%86%D8%AC%D8%A7%20%D9%88%D8%A7%D8%B1%D8%AF%20%DA%A9%D9%86%DB%8C%D8%AF%E2%80%A6&characters=true&digits=persian&half_space=true&punctuation_spacing=true&persian_punctuation=true&remove_diacritics=true&whitespace=true"
  },
  "cli": "gizza tool persian-text-normalizer \"متن فارسی را اینجا وارد کنید…\"",
  "tool": {
    "description": "Normalize Persian/Farsi text in one configurable pass. Replace Arabic letters with Persian equivalents (characters = true: ك->ک, ي->ی, ى->ی, ة->ه), convert digits (digits = persian/english/keep; default persian maps 0-9 and ٠-٩ to ۰-۹), fix half-spaces / ZWNJ (half_space = true attaches می/نمی prefixes and ها/تر/ترین suffixes with a نیم‌فاصله and tidies stray spacing around existing ZWNJ), correct punctuation spacing (punctuation_spacing = true: no space before . ، ؛ ؟ ! :, one space after, sparing decimal/time/thousands separators), optionally convert Latin punctuation to Persian (persian_punctuation = true: , -> ،, ; -> ؛, ? -> ؟), optionally strip Arabic diacritics/kashida (remove_diacritics = true), and clean whitespace (whitespace = true collapses runs, normalizes line endings, trims). Steps run in the order characters -> remove diacritics -> digits -> Persian punctuation -> half-space -> punctuation spacing -> whitespace.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "characters": {
          "default": true,
          "description": "When true (default), replace Arabic letters with their Persian equivalents: ك -> ک, ي -> ی, ى (alef maksura) -> ی, and ة (teh marbuta) -> ه.",
          "type": "boolean"
        },
        "digits": {
          "default": "persian",
          "description": "Digit script. 'persian' (default) converts ASCII (0-9) and Arabic-Indic (٠-٩) digits to Persian (۰-۹); 'english' converts Persian and Arabic-Indic digits to ASCII; 'keep' leaves digits untouched.",
          "enum": [
            "persian",
            "english",
            "keep"
          ],
          "type": "string"
        },
        "half_space": {
          "default": true,
          "description": "When true (default), fix half-spaces (ZWNJ / نیم‌فاصله): tidy spacing around existing ZWNJ characters and attach common affixes with a half-space — verb prefixes می/نمی and plural/comparative suffixes ها/های/هایی/تر/تری/ترین.",
          "type": "boolean"
        },
        "persian_punctuation": {
          "default": false,
          "description": "When true, convert Latin punctuation to Persian equivalents: comma -> ، , semicolon -> ؛ , and question mark -> ؟. A comma between digits (thousands separator) is kept. Default false.",
          "type": "boolean"
        },
        "punctuation_spacing": {
          "default": true,
          "description": "When true (default), correct punctuation spacing: remove spaces before . ، ؛ ؟ ! : and leave exactly one space after. Decimal, time, and thousands separators (3.14, 10:30, 1,000) are left intact.",
          "type": "boolean"
        },
        "remove_diacritics": {
          "default": false,
          "description": "When true, remove Arabic diacritics (harakat / تشکیل, e.g. fatha, damma, kasra, shadda, sukun) and the kashida (tatweel ـ). Default false.",
          "type": "boolean"
        },
        "text": {
          "description": "The Persian/Farsi text to normalize.",
          "type": "string"
        },
        "whitespace": {
          "default": true,
          "description": "When true (default), collapse repeated spaces/tabs to one space, normalize line endings to \\n, drop blank surrounding lines, and trim the ends.",
          "type": "boolean"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    }
  }
}