abbreviations_py.textes package

Installation

pip install abbreviations_py

abbreviations_py.textes.abbreviator module

abbreviations_py.textes.abbreviator.fix(text)

Fixes the abbreviated input text by replacing abbreviations, removing punctuations and hashtag terms.

Parameters: text (str): The input abbreviated text to be fixed.

Returns: str: The fixed text.

abbreviations_py.textes.abbreviator.update_abbreviations(new_mappings)

Updates the abbreviation mappings dictionary with new key-value pairs.

Parameters: new_mappings (dict): The new key-value pairs to add to the abbreviation mappings.

Returns: None

Usage Example

from abbreviations_py.textes.abbreviator import fix, update_abbreviations

# Fix abbreviated text
input_text = "I'll txt you when you're back, ttyl! #BonVoyage"
result = fix(input_text)
print(result)
# Output: I will text you when you are back talk to you later

# Update abbreviation mappings
new_mappings = {
    "ttyl": "talk to you later",
    "txt": "text",
    # Add more mappings here
}

update_abbreviations(new_mappings)