🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

farsi-tools

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

farsi-tools

Farsi Tools: Tools for processing Farsi (Persian) text

0.2
PyPI
Maintainers
1

alt text alt text

Farsi Tools: tools for processing Farsi (Persian) text

Tested with:

  • Python 3.5+

Use the following command to install using pip:

pip install farsi-tools

Usage example

Converting digits

Use replace_arabic_digits_with_farsi method to replace arabic digits with farsi digits.

from farsi_tools import replace_arabic_digits_with_farsi

replace_arabic_digits_with_farsi('٤')  # returns ۴

Use replace_ascii_digits_with_farsi method to replace ASCII digits with farsi digits.

from farsi_tools import replace_ascii_digits_with_farsi

replace_ascii_digits_with_farsi('4')  # returns ۴

Use replace_farsi_digits_with_ascii method to replace farsi digits with ASCII digits.

from farsi_tools import replace_farsi_digits_with_ascii

replace_farsi_digits_with_ascii('۴')  # returns 4

Use replace_arabic_digits_with_ascii method to replace farsi digits with ASCII digits.

from farsi_tools import replace_arabic_digits_with_ascii

replace_arabic_digits_with_ascii('٤')  # returns 4

Convert text to Farsi (Persian)

Use standardize_persian_text method to convert characters to standard persian form

from farsi_tools import standardize_persian_text

standardize_persian_text('سلام خوبي؟ کمك ﻧميخواي؟') # returns "سلام خوبی؟ کمک نمیخوای؟"

Get Farsi (Persian) stop-words

Use stopwords method to retrieve list of persian stop-words

from farsi_tools import stop_words

stop_words()

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts