پاک‌نویس paknevis

ویراستار خودکار متن فارسی — مثل Prettier و ESLint، برای نوشتار فارسی

In one sentenceدر یک جمله

paknevis is a careful copy editor for Persian text: it fixes half-spaces, Arabic ي and ك, digits and punctuation, and leaves code, links and markup alone.

پاک‌نویس یک ویراستار دقیق برای متن فارسی است: نیم‌فاصله‌ها، «ي» و «ك» عربی، رقم‌ها و نشانه‌گذاری را درست می‌کند و به کد، پیوندها و برچسب‌ها دست نمی‌زند.

در انتظار بارگذاری موتور…
نمونه‌ها:
0

فهرست مشکلات

    هیچ مشکلی پیدا نشد. ✨

    در پروژهٔ خودتان

    همین موتور به‌صورت کتابخانهٔ پایتون، خط فرمان، هوک pre-commit و GitHub Action در دسترس است.

    pip install "paknevis @ git+https://github.com/mrzroot/paknevis"
    paknevis check docs/          # report
    paknevis fix --diff thesis.tex  # preview fixes
    How it worksچطور کار می‌کند

    From messy to clean in four stepsاز نامرتب تا پاک‌نویس در چهار گام

    1. Paste or point it at filesمتن بدهید یا فایل‌ها را نشان دهید

      Plain text, Markdown, HTML or LaTeX, in the editor above, the CLI or Python.متن ساده، مارک‌داون، HTML یا LaTeX؛ در ویرایشگر بالا، خط فرمان یا پایتون.

    2. It protects what is not proseهرچه نوشته نیست کنار می‌رود

      Code, URLs, e-mails, tags, math and LaTeX commands are fenced off and never changed.کد، نشانی‌ها، ایمیل، تگ‌ها، فرمول و دستورهای LaTeX جدا می‌شوند و هرگز عوض نمی‌شوند.

    3. 25 rules read the rest۲۵ قاعده بقیه را می‌خوانند

      Half-spaces (می‌روم, کتاب‌ها), Arabic ي/ك, digits, punctuation, spacing, quotes and common misspellings.نیم‌فاصله (می‌روم، کتاب‌ها)، ي/ك عربی، رقم‌ها، نشانه‌گذاری، فاصله‌ها، گیومه و غلط‌های رایج.

    4. You review, then keepبازبینی می‌کنید و نگه می‌دارید

      See every change with a rule id and a reason, or use --diff / --check in CI before anything is written.هر تغییر را با شناسهٔ قاعده و دلیلش می‌بینید؛ یا در CI با --diff یا --check پیش از نوشتن بررسی می‌کنید.

    چرا پاک‌نویسWhy paknevis

    ویراستاری دقیق که هیچ‌وقت کد شما را خراب نمی‌کند.A careful copy editor that never breaks your code.

    نیم‌فاصله، حروف عربی، نشانه‌گذاری، رقم‌ها و غلط‌های رایج را درست می‌کند و به کد، لینک، مارک‌آپ و فرمول دست نمی‌زند.It fixes ZWNJ, Arabic characters, punctuation, digits and common misspellings, and leaves code, URLs, markup and math alone.

    🧩

    آگاه از قالبFormat-aware

    متن ساده، Markdown، HTML و LaTeX (با XePersian)؛ بلوک‌های کد، فرانت‌متر، تگ‌ها، فرمول‌ها و \lr{…} محافظت می‌شوند. پشتیبانی اختیاری از ‎.docx.Plain text, Markdown, HTML and LaTeX (XePersian-aware). Code, front matter, tags, math and \lr{…} are protected. Optional .docx support.

    🛡️

    محافظه‌کارConservative by design

    قاعده‌ها فقط در بافت فارسی عمل می‌کنند: Python 3.12 یا «میز» و «میدان» دست نمی‌خورند.Rules act only in Persian context: Python 3.12, 10GB or nouns like «میز» and «میدان» stay untouched.

    🔁

    تکرارپذیرIdempotent

    fix(fix(x)) == fix(x)؛ با تست‌های property-based همراه با «ناحیه‌های محافظت‌شده هرگز تغییر نمی‌کنند».fix(fix(x)) == fix(x), verified with property-based tests, along with “protected regions never change”.

    📏

    ۲۵ قاعدهٔ مستند25 documented rules

    هر قاعده کد (PN203)، نام، شدت، توضیح دوزبانه و مثال دارد و جداگانه قابل خاموش کردن است.Each has a code (PN203), a name, a severity, a bilingual explanation and examples, and can be turned off.

    ⚙️

    قابل پیکربندیConfigurable

    در pyproject.toml: سبک رقم، «خانه‌ی» یا «خانهٔ»، واژه‌نامهٔ اختصاصی و دستورهای paknevis-disable.In pyproject.toml: digit style, «خانه‌ی» vs «خانهٔ», custom dictionaries and inline paknevis-disable comments.

    🔒

    همین موتور، در مرورگرThe real engine, in your browser

    ویرایشگر بالا خودِ پکیج پایتون را با Pyodide اجرا می‌کند؛ پس با CLI همیشه یکسان است و متن شما جایی نمی‌رود.The editor above runs the actual Python package via Pyodide, so it always agrees with the CLI, and your text never leaves the page.

    پیش و پسBefore / after

    یک جمله، شش اصلاح.One sentence, six fixes.

    پیشbefore
    امروز مي خواهم درباره ي نرم افزار هاي متن باز بنویسم , اما وقت ندارم ...
    پسafter
    امروز می‌خواهم درباره‌ی نرم‌افزارهای متن باز بنویسم، اما وقت ندارم…
    LaTeX
    \section{بيان مسئله} در این پژوهش , روش های جدید را بررسی می کنیم \cite{goodfellow2016}.
    LaTeX
    \section{بیان مسئله} در این پژوهش، روش‌های جدید را بررسی می‌کنیم \cite{goodfellow2016}.
    قاعده‌هاRules

    ۲۵ قاعده در ۵ دسته.25 rules in 5 families.

    با paknevis explain PN203 توضیح کامل و مثال هر قاعده را ببینید.Run paknevis explain PN203 for the full explanation and examples of any rule.

    نویسه‌هاCharactersPN1xx

    • 101ي → ی
    • 102ك → ک
    • 103«ه» غیرفارسیnon-Persian heh
    • 104تای گرد «ة»teh marbuta «ة»
    • 105رقم‌های عربیArabic digits
    • 106سبک رقمdigit style

    نیم‌فاصلهZWNJPN2xx

    • 201نیم‌فاصلهٔ زائدstray / duplicate
    • 202می روم → می‌روم
    • 203کتاب ها → کتاب‌ها
    • 204بزرگ ترین → بزرگ‌ترین
    • 205خانه ای → خانه‌ای

    نشانه‌گذاریPunctuationPN3xx

    • 301, → ،
    • 302; → ؛
    • 303? → ؟
    • 304فاصلهٔ پیش از نشانهspace before
    • 305فاصلهٔ پس از نشانهspace after
    • 306کمانک و گیومهbrackets & quotes
    • 307"…" → «…»
    • 308... → …
    • 309؟؟؟ → ؟

    فاصله‌هاWhitespacePN4xx

    • 401فاصله‌های پشت‌سرهمrepeated spaces
    • 402فاصلهٔ پایان سطرtrailing whitespace
    • 403کشیده «ـ»kashida «ـ»

    املاSpellingPN5xx

    • 501واژه‌نامهٔ YAML قابل گسترشextensible YAML dictionary
    • 502لطفا → لطفاً
    همه‌جاEverywhere

    در ترمینال، کد، کامیت و CI.In your terminal, code, commits and CI.

    هنوز در PyPI نیست؛ از گیت‌هاب نصب کنید (پایتون ۳٫۱۰ تا ۳٫۱۳). کدهای خروج مناسب CI: ۰ تمیز، ۱ مشکل، ۲ خطا.Not on PyPI yet, so install from GitHub (Python 3.10–3.13). CI-friendly exit codes: 0 clean, 1 issues, 2 error.

    pip install "paknevis @ git+https://github.com/mrzroot/paknevis@v0.1.0"
    
    paknevis check docs/              # report problems
    paknevis fix --diff thesis.tex    # preview fixes
    paknevis fix --check .            # CI: exit 1 if files would change
    paknevis fix .                    # rewrite in place
    cat notes.txt | paknevis fix -    # stdin → stdout
    paknevis explain zwnj-plural
    پرسش‌هاFAQ

    پرسش‌های رایجFrequently asked

    متن من به سروری فرستاده می‌شود؟Is my text uploaded anywhere?

    نه. Pyodide و پکیج یک بار دانلود می‌شوند و همه‌چیز داخل مرورگر اجرا می‌شود. CLI و Action هم کاملاً محلی‌اند.No. Pyodide and the package are downloaded once and everything runs in your browser. The CLI and the Action are fully local too.

    کد و فرمول‌های من را خراب نمی‌کند؟Will it mangle my code or math?

    نه. کد درون‌خطی و بلوکی، URLها، تگ‌ها و ویژگی‌های HTML، فرانت‌متر، $…$، دستورهای LaTeX و محیط‌های verbatim و TikZ محافظت می‌شوند؛ با تست بررسی شده که هرگز تغییر نکنند.No. Inline and fenced code, URLs, HTML tags and attributes, front matter, $…$, LaTeX commands and verbatim/TikZ environments are protected, and tests check they never change.

    چرا بعضی نیم‌فاصله‌ها را اصلاح نمی‌کند؟Why does it skip some ZWNJ fixes?

    پاک‌نویس قاعده‌محور است، نه تحلیلگر کامل صرفی. برای جلوگیری از خطای مثبت، فقط فهرست گزیده‌ای از ستاک‌ها را اصلاح می‌کند. اگر خطایی دیدید جمله را در Issue بفرستید.It's rule-based, not a full morphological analyser. To avoid false positives it only fixes a curated list of stems. Spotted a miss or a false positive? Open an issue with the sentence.

    «خانه‌ی» یا «خانهٔ»؟«خانه‌ی» or «خانهٔ»?

    هر دو. با گزینهٔ ezafe (یا منوی بالا) سبک دلخواهتان را انتخاب کنید؛ رقم‌ها هم فارسی، لاتین یا دست‌نخورده می‌توانند بمانند.Either. Pick your style with the ezafe option (or the menu above). Digits can be Persian, Latin or left as they are.

    مجوز؟License?

    MIT. قلم وزیرمتن با مجوز SIL OFL 1.1 در همین صفحه میزبانی می‌شود.MIT. The Vazirmatn font is self-hosted on this page under the SIL OFL 1.1.

    Latest releaseآخرین نسخه

    Ready to installآمادهٔ نصب

    v0.1.0
    Published 2026-10-08. Includes Python wheel and source archive.منتشرشده در 2026-10-08. شامل فایل wheel پایتون و آرشیو سورس.

    نوشتهٔ فارسی‌تان را پاک‌نویس کنید.Give your Persian writing a clean copy.