Skip to main content

Farsi Tools: Tools for processing Farsi (Persian) text

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

farsi_tools-0.2.tar.gz (13.0 kB view hashes)

Uploaded Source

Built Distribution

farsi_tools-0.2-py3-none-any.whl (13.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page