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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file farsi_tools-0.2.tar.gz.

File metadata

  • Download URL: farsi_tools-0.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for farsi_tools-0.2.tar.gz
Algorithm Hash digest
SHA256 afe7b0bb0c8f5fcab7464d63568552fea6440ed5a04850df26913e9b4abb018d
MD5 13b7019d979c80749863b92952682134
BLAKE2b-256 85d33fdd1844fe682ca9665594d2ba79a6bf17ee9ec42a21ecebcb7986a69176

See more details on using hashes here.

File details

Details for the file farsi_tools-0.2-py3-none-any.whl.

File metadata

  • Download URL: farsi_tools-0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for farsi_tools-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9396dcbc6219754b570f893663e31b83aa10ba8c5916b361445b66584beb7e50
MD5 b591f732f438b95d920a45343bc0acbe
BLAKE2b-256 50ffc431144c6d579c0549e1899bcbd7ec9ab2d08566e198b7df8ad0ac1eeb30

See more details on using hashes here.

Supported by

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