Virastar Library

Cleaning-up Persian Texts!

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.greasyfork.org/scripts/527228/1538801/Virastar%20Library.js

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
Mohammad Khani
Verze
0.21.0
Vytvořeno
17. 02. 2025
Aktualizováno
17. 02. 2025
Size
33,4 KB
Licence
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.