Virastar Library

Cleaning-up Persian Texts!

이 스크립트는 직접 설치해서 쓰는 게 아닙니다. 다른 스크립트가 메타 명령 // @require https://update.greatest.deepsurf.us/scripts/527228/1538801/Virastar%20Library.js(으)로 포함하여 쓰는 라이브러리입니다.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
개발자
Amm1rr
버전
0.21.0
생성
2025-02-17
갱신
2025-02-17
크기
33.4KB
라이선스
MIT

Virastar is a JavaScript library designed to process and standardize Persian text, enhancing its readability and ensuring compatibility across various platforms. It offers a comprehensive suite of functions that address common typographical and formatting issues in Persian writing.

Key Features:

  • Normalization of End-of-Line Characters: Converts Windows-style line breaks to Unix-style, ensuring consistent text formatting.

  • HTML Entity Decoding: Transforms numeric and selected HTML character entities into their corresponding characters, preserving the integrity of the text.

  • Dash Correction: Replaces triple dashes with an em dash and double dashes with an en dash, adhering to proper punctuation standards.

  • Ellipsis Standardization: Removes spaces between dots and replaces multiple dots with a single ellipsis character, maintaining typographical accuracy.

  • Date Formatting: Reorders date components and replaces delimiters with slashes, aligning with standard Persian date conventions.

  • Quotation Mark Replacement: Substitutes English quotation marks with their Persian equivalents, ensuring consistency in punctuation.

  • Hamzeh Correction: Addresses common issues with the Persian letter 'ه' followed by 'ی' or 'ء', replacing them with the standard 'هٔ'.

  • Arabic Character Conversion: Converts Arabic characters to their Persian counterparts, standardizing the script.

  • Zero-Width Non-Joiner (ZWNJ) Management: Cleans unnecessary ZWNJ characters, particularly around numbers, English words, spaces, and punctuation marks, to prevent unwanted word breaks.

  • Number Conversion: Replaces Arabic and English numerals with their Persian equivalents, ensuring numerical consistency.

  • Punctuation Standardization: Replaces English punctuation marks with their Persian counterparts, maintaining typographical consistency.

  • Spacing Adjustments: Removes unnecessary spaces before and after punctuation marks, parentheses, and braces, adhering to proper spacing conventions.

  • Diacritic Management: Cleans up diacritic characters, ensuring they are correctly placed and do not interfere with text readability.

  • Preservation Options: Allows for the preservation of frontmatter, HTML tags, comments, entities, URIs, and specific brackets or braces, providing flexibility in text processing.

By integrating Virastar into your projects, you can automate the cleaning and standardization of Persian text, leading to improved readability and consistency across your applications.