Closed yashksaini-coder closed 2 weeks ago
👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!
Feel free to join our community on Discord to discuss more!
✅ Closes: #243
This pull request introduces several new functions for string manipulation and conversion, along with enhancements to existing functions by adding input validation. Additionally, it includes a new test suite for the conversion functions.
New Functions for String Conversion:
pysnippets/Strings/basic_conversion.py
: Addednumber_to_words_basic
andwords_to_number_basic
functions for basic number-to-words and words-to-number conversions.pysnippets/Strings/dict_conversion.py
: Addednumber_to_words_advanced
andwords_to_number_advanced
functions for advanced number-to-words and words-to-number conversions using dictionaries.pysnippets/Strings/inflect_conversion.py
: Addednumber_to_words_inflect
andwords_to_number_inflect
functions for number-to-words and words-to-number conversions using theinflect
library.pysnippets/Strings/regex.py
: Addednumber_to_words_regex
andwords_to_number_regex
functions for number-to-words and words-to-number conversions using regular expressions.Input Validation Enhancements:
pysnippets/Strings/anagram_detector.py
: Added input validation to ensure both inputs are strings.pysnippets/Strings/levenshtein_distance.py
: Added input validation to ensure both inputs are strings.pysnippets/Strings/snake_to_camel.py
: Added input validation to ensure the input is a string.pysnippets/Strings/string_normalizer.py
: Added input validation to ensure the input is a string.pysnippets/Strings/string_statistics.py
: Added input validation in the__post_init__
method to ensuretext
is a string.pysnippets/Strings/string_utils.py
: Added input validation in the__post_init__
method andreplace_substring
method to ensure inputs are strings. [1] [2]Testing:
pysnippets/Strings/test_conversion.py
: Added a new test suite usingunittest
for the conversion functions, including tests for basic, regex, advanced dictionary, and inflect conversions.TESTING
@UTSAVS26 kindly review this PR