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:
- General Processing Functions: Functions applicable to both English and Arabic texts.
- English-Specific Functions: Functions designed specifically for English language processing.
- 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
stringmodule is used for accessing predefined ASCII tables and punctuation lists, which simplifies text filtering. - The
remodule 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)
- space_count: Counts the total number of spaces in the given text.
- word_count: Counts the total number of words in the given text.
- line_count: Counts the total number of lines in the given text.
- sentence_count: Counts the total number of sentences in the given text.
- character_count: Counts the total number of characters, excluding spaces.
- special_characters_count: Counts the total number of punctuation marks.
- specific_character_count: Counts occurrences of a specific character in the text.
- specific_word_character_count: Counts words containing a specific character.
- longest_word: Finds and returns the longest word in the text.
- extra_space_clean: Removes extra spaces from the text.
- special_character_removal: Removes punctuation marks from the text.
- word_beginning: Identifies and counts words beginning with a specified letter.
- word_end: Identifies and counts words ending with a specified character.
- repeated_words: Identifies and counts repeated words.
- word_check: Checks if a specific word exists within the text.
- selected_word_length_display: Displays words of a specified length.
- word_reversal: Reverses words in the text that meet a length criterion.
- suffix_words: Identifies words ending with a specified suffix.
- prefix_words: Identifies words starting with a specified prefix.
English-Specific Functions
- vowel_consonant_count: Counts vowels and consonants in the text.
- upper_lower_count: Counts uppercase and lowercase letters in the text.
- ed_ing_count: Counts words ending with 'ed' and 'ing'.
- uncontract_word: Expands contracted words to their full forms.
- english_stop_words_removal: Removes common English stop words.
- title_format: Formats the title according to English title capitalization rules.
- definite_english_detection: Detects and counts definite nouns preceded by "the".
- indefinite_english_detection: Detects and counts indefinite nouns preceded by "a" or "an".
- sentence_capitalize: Capitalizes the first letter of each sentence in a string.
Arabic-Specific Functions
- definite_arabic: Identifies and extracts words beginning with the Arabic definite article "ال".
- feminine_arabic_sign: Identifies words ending with the Arabic feminine sign "ة".
- feminine_plural_arabic: Identifies words ending with Arabic feminine plural suffixes.
- diacritics_removal: Removes diacritics from Arabic text.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
826d1c937c17ac722cfad75c136556450f489699a34f91d133a71f8c61824ad1
|
|
| MD5 |
8538892c0a928663bfce70134b0c7223
|
|
| BLAKE2b-256 |
fd9074cc6b6dbdaa6260d6c48654c984b0405f42a4d7cc4a76dbc72b353323a0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e174bf6658634a6a9cb671e2a54dcbc5aed989eb766970b50d39f09048efb73
|
|
| MD5 |
ea8c7735d8ea3aad429d43d658bfc5f7
|
|
| BLAKE2b-256 |
1e31e57486101ad2cf80929ed7a23fcad58debb12a5e0ae607fc3c2f070382d6
|