Python/strings
Rohan Sardar e29024d14a
Program to convert a given string to Pig Latin (#9712)
* Program to convert a given string to Pig Latin 

This is a program to convert a user given string to its respective Pig Latin form

As per wikipedia (link: https://en.wikipedia.org/wiki/Pig_Latin#Rules)
For words that begin with consonant sounds, all letters before the initial vowel are placed at the end of the word sequence. Then, "ay" is added, as in the following examples:
"pig" = "igpay"
"latin" = "atinlay"
"banana" = "ananabay"

When words begin with consonant clusters (multiple consonants that form one sound), the whole sound is added to the end when speaking or writing.
"friends" = "iendsfray"
"smile" = "ilesmay"
"string" = "ingstray"

For words that begin with vowel sounds, one just adds "hay", "way" or "yay" to the end. Examples are:
"eat" = "eatway"
"omelet" = "omeletway"
"are" = "areway"

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pig_latin.py

Added f-string

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pig_latin.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pig_latin.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pig_latin.py

* Update pig_latin.py

* Update pig_latin.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-10-05 10:52:40 +02:00
..
__init__.py Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
aho_corasick.py clean of unnecessary checks, imports, calls (#7993) 2022-11-21 00:00:27 +13:00
alternative_string_arrange.py add alternative_string_arrange method (#4595) 2021-08-06 12:15:42 +02:00
anagrams.py Increased Readability Of Variables (#6400) 2022-10-30 08:11:17 +01:00
anagrams.txt edited strings/anagram.py (#5770) 2021-11-08 18:58:15 +01:00
autocomplete_using_trie.py Make some ruff fixes (#8154) 2023-03-01 17:23:33 +01:00
barcode_validator.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
boyer_moore_search.py Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062) 2022-10-13 00:54:20 +02:00
can_string_be_rearranged_as_palindrome.py Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062) 2022-10-13 00:54:20 +02:00
capitalize.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
check_anagrams.py Replace bandit, flake8, isort, and pyupgrade with ruff (#8178) 2023-03-15 13:58:25 +01:00
credit_card_validator.py Fix spellings (#5710) 2021-10-31 11:36:03 +01:00
detecting_english_programmatically.py Refactoring the syntax using list comprehension (#7749) 2022-10-27 23:02:15 +02:00
dictionary.txt Move files to strings folder (#4283) 2021-03-21 12:05:10 +01:00
dna.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30
frequency_finder.py Change to https. (#7277) 2022-10-16 09:43:29 +02:00
hamming_distance.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30
indian_phone_validator.py Adopt Python >= 3.8 assignment expressions using auto-walrus (#7737) 2022-10-28 15:54:54 +02:00
is_contains_unique_chars.py fix typo (#6375) 2022-09-21 16:37:38 +01:00
is_isogram.py Added function that checks if a string is an isogram (#7608) 2022-10-26 16:31:16 +13:00
is_pangram.py Update comments in check_pangram.py script (#7564) 2022-10-23 18:00:59 +02:00
is_spain_national_id.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
is_srilankan_phone_number.py Fix ruff rules ISC flake8-implicit-str-concat (#8892) 2023-07-28 17:53:09 +01:00
is_valid_email_address.py Create is valid email address algorithm (#8907) 2023-08-14 01:28:52 -07:00
jaro_winkler.py Set the Python file maximum line length to 88 characters (#2122) 2020-06-16 10:09:19 +02:00
join.py refactor: Indent ... for visual purposes (#7744) 2022-10-27 19:42:30 +02:00
knuth_morris_pratt.py Returning Index instead of boolean in knuth_morris_pratt (kmp) function, making it compatible with str.find(). (#9083) 2023-09-28 20:24:46 +02:00
levenshtein_distance.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30
lower.py Fixed typo in docstring (#4326) 2021-04-12 13:40:10 +02:00
manacher.py Fix some typos (#6113) 2022-05-01 18:44:23 +08:00
min_cost_string_conversion.py [Upgrade Ruff] Fix all errors raised from ruff (#8879) 2023-07-22 12:05:10 +02:00
naive_string_search.py [mypy] Fix type annotations for strings/naive_string_search.py (#4611) 2021-08-13 09:10:52 +02:00
ngram.py feat: add strings/ngram algorithm (#6074) 2022-04-04 09:06:32 +05:30
palindrome.py Merge and add benchmarks to palindrome algorithms in the strings/ directory (#8749) 2023-05-25 12:56:23 +02:00
pig_latin.py Program to convert a given string to Pig Latin (#9712) 2023-10-05 10:52:40 +02:00
prefix_function.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30
rabin_karp.py [pre-commit.ci] pre-commit autoupdate (#9013) 2023-08-29 15:18:10 +02:00
remove_duplicate.py Fixed remove duplicate (#2470) 2020-09-24 19:14:52 +08:00
reverse_letters.py Added reverse_letters.py (#3730) 2020-10-27 12:05:37 +08:00
reverse_long_words.py add an algorithm to spin some words (#5597) 2021-10-25 19:18:41 +02:00
reverse_words.py Fixed reverse words algorithm (#2469) 2020-09-24 19:12:52 +08:00
snake_case_to_camel_pascal_case.py Add more ruff rules (#8767) 2023-05-26 09:34:17 +02:00
split.py Set the Python file maximum line length to 88 characters (#2122) 2020-06-16 10:09:19 +02:00
string_switch_case.py Switch case (#7995) 2023-05-11 06:53:47 +12:00
text_justification.py pre-commit: Upgrade psf/black for stable style 2023 (#8110) 2023-02-01 18:44:54 +05:30
top_k_frequent_words.py Solving the Top k most frequent words problem using a max-heap (#8685) 2023-04-27 23:02:07 +05:30
upper.py Modified comments on upper.py (#3884) 2020-11-18 12:07:30 +05:30
wave.py Wave (#6061) 2022-06-24 00:47:29 +08:00
wildcard_pattern_matching.py Add wildcard pattern matching using dynamic programming (#5334) 2021-10-20 16:30:58 +08:00
word_occurrence.py Replace bandit, flake8, isort, and pyupgrade with ruff (#8178) 2023-03-15 13:58:25 +01:00
word_patterns.py Add pep8-naming to pre-commit hooks and fixes incorrect naming conventions (#7062) 2022-10-13 00:54:20 +02:00
words.txt Moved "other/anagrams.py" to the string folder (#4289) 2021-03-22 11:40:23 +01:00
z_function.py Add missing type annotations for strings directory (#5817) 2022-05-13 13:55:53 +08:00