Skip to main content

A Python library for text analysis and processing in English and Arabic.

Project description

TextMasterPy Framework

This framework is designed to assist developers in performing efficient text analysis and processing tasks for both English and Arabic texts. It is built to handle a variety of common text processing operations and is structured into three categories: general processing functions (usable for both English and Arabic), English-specific functions, and Arabic-specific functions.

Framework Overview

This framework consists of 33 generic functions organized into three main categories:

  1. General Processing Functions: Functions applicable to both English and Arabic texts.
  2. English-Specific Functions: Functions designed specifically for English language processing.
  3. Arabic-Specific Functions: Functions designed specifically for Arabic language processing.

The framework is designed for Python 3.12.7 and depends on some Python built-in modules, specifically string and re.

  • The string module is used for accessing predefined ASCII tables and punctuation lists, which simplifies text filtering.
  • The re module is used for regular expression-based operations, though it is intentionally minimized to keep functions as generic and flexible as possible.

This framework will be updated regularly to include new features and improvements.

Function Categories

General Processing Functions (Applicable to Both English and Arabic)

  1. space_count: Counts the total number of spaces in the given text.
  2. word_count: Counts the total number of words in the given text.
  3. line_count: Counts the total number of lines in the given text.
  4. sentence_count: Counts the total number of sentences in the given text.
  5. character_count: Counts the total number of characters, excluding spaces.
  6. special_characters_count: Counts the total number of punctuation marks.
  7. specific_character_count: Counts occurrences of a specific character in the text.
  8. specific_word_character_count: Counts words containing a specific character.
  9. longest_word: Finds and returns the longest word in the text.
  10. extra_space_clean: Removes extra spaces from the text.
  11. special_character_removal: Removes punctuation marks from the text.
  12. word_beginning: Identifies and counts words beginning with a specified letter.
  13. word_end: Identifies and counts words ending with a specified character.
  14. repeated_words: Identifies and counts repeated words.
  15. word_check: Checks if a specific word exists within the text.
  16. selected_word_length_display: Displays words of a specified length.
  17. word_reversal: Reverses words in the text that meet a length criterion.
  18. suffix_words: Identifies words ending with a specified suffix.
  19. prefix_words: Identifies words starting with a specified prefix.

English-Specific Functions

  1. vowel_consonant_count: Counts vowels and consonants in the text.
  2. upper_lower_count: Counts uppercase and lowercase letters in the text.
  3. ed_ing_count: Counts words ending with 'ed' and 'ing'.
  4. uncontract_word: Expands contracted words to their full forms.
  5. english_stop_words_removal: Removes common English stop words.
  6. title_format: Formats the title according to English title capitalization rules.
  7. definite_english_detection: Detects and counts definite nouns preceded by "the".
  8. indefinite_english_detection: Detects and counts indefinite nouns preceded by "a" or "an".
  9. sentence_capitalize: Capitalizes the first letter of each sentence in a string.

Arabic-Specific Functions

  1. definite_arabic: Identifies and extracts words beginning with the Arabic definite article "ال".
  2. feminine_arabic_sign: Identifies words ending with the Arabic feminine sign "ة".
  3. feminine_plural_arabic: Identifies words ending with Arabic feminine plural suffixes.
  4. diacritics_removal: Removes diacritics from Arabic text.
  5. singular_extended_arabic: Identifies singular extended Arabic nouns ending with "اء".

Usage Example

Below is an example of how you can use the space_count function:

from generalprocessing import space_count

text = "This is an example text." result = space_count(text) print(f"Number of spaces: {result}") Help Function For detailed information about any specific function, you can use Python's built-in help() function:

help(space_count)

Installation To install this framework, simply clone the repository: https://github.com/Abdullahashraf32/textprocessing.git Ensure you have Python 3 installed. Contributions Feel free to contribute by submitting issues or pull requests. License This framework is open-source and available under the MIT License. Best wishes!

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

textmasterpy-1.0.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

textmasterpy-1.0.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file textmasterpy-1.0.1.tar.gz.

File metadata

  • Download URL: textmasterpy-1.0.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for textmasterpy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 826d1c937c17ac722cfad75c136556450f489699a34f91d133a71f8c61824ad1
MD5 8538892c0a928663bfce70134b0c7223
BLAKE2b-256 fd9074cc6b6dbdaa6260d6c48654c984b0405f42a4d7cc4a76dbc72b353323a0

See more details on using hashes here.

File details

Details for the file textmasterpy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: textmasterpy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for textmasterpy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e174bf6658634a6a9cb671e2a54dcbc5aed989eb766970b50d39f09048efb73
MD5 ea8c7735d8ea3aad429d43d658bfc5f7
BLAKE2b-256 1e31e57486101ad2cf80929ed7a23fcad58debb12a5e0ae607fc3c2f070382d6

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