Skip to main content

A Python package to check if a text is informal Persian.

Project description

Persian-Informal-Text-Detector

Persian Informal Text Detector is a rule-based informal text detector based on regular expressions. It can be used to identify informal Persian text by detecting certain indicators such as informal words and verb formats.

Source of Informal Text Indicators

Some of the informal text indicators, such as informal words and verb formats, are derived from this Wikipedia page.

Installation

You can install Persian Informal Text Detector using pip:

pip install informal_detector

Example Usage

from informal_detector import is_informal

# Returns True since the text contains at least one informal indicator
result1 = is_informal("دلم میخواد برم خونه", threshold=1)
print(result1)  # Output: True

# Returns False since the text does not contain enough informal indicators
result2 = is_informal("نباید به خانه بروم", threshold=1)
print(result2)  # Output: False

The threshold Argument

The threshold keyword argument is crucial as it indicates how strict the detector should be. It determines the number of informal Persian indicators, such as informal words and verbs, required to classify a text as informal.

A lower threshold is suitable for smaller text files, while a higher threshold is more appropriate for larger files where some formal sentences might exist but the text should still be marked as informal if it contain a significant number of informal indicators. A threshold of 1 means that a text is considered informal if it contains at least one informal word or verb.

Contribution

If you come across any issues or have ideas for improvements, please don't hesitate to let us know by opening an issue or sending a pull request. Thank you for using Persian Informal Text Detector!

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

informal_detector-0.1.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

informal_detector-0.1.2-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file informal_detector-0.1.2.tar.gz.

File metadata

  • Download URL: informal_detector-0.1.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.5

File hashes

Hashes for informal_detector-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6265daa7912a6a572b8738369a10242e8d00d702c8e181ff4d9dd3f6ed157953
MD5 f470b73380e8d85f15cd85dfe114e392
BLAKE2b-256 85c784f04f42f68cd467280215863085da57ca772b94cede0c904f3feb2fdaea

See more details on using hashes here.

File details

Details for the file informal_detector-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for informal_detector-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 60829b386dd0ca07cfbfb15386948db0aec4e68dd62667bfbc6ae18169f2c10b
MD5 58d47e054997903f274bb2f3e5c4072f
BLAKE2b-256 6a69c6d5051f62eb832ff4b6c04e9cbf4f3c3ccad60bc844db62cccf46a0bfb9

See more details on using hashes here.

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