("Pig Latin is not possible, the string must have at least a vowel. String plstring8=pigLatinWord("nymphly") //contains no vowel String plstring7=pigLatinWord("eunoia") //contains all vowels String plstring6=pigLatinWord("store") //consonant cluster word String plstring5=pigLatinWord("egg") //begin with vowel String plstring4=pigLatinWord("child") //consonant cluster word String plstring3=pigLatinWord("me") //begin with consonant String plstring2=pigLatinWord("apple") //begin with vowel String plstring1=pigLatinWord("butter") //begin with consonant Return string.substring(index) + string.substring(0, index) + "ay" Append all characters which are before index. Take all characters after index (including index). Pig Latin is possible only if vowels is present Static String pigLatinWord(String string) Learning how to speak pig latin is as fun as it is easy Expand your children's language art skills by exploring our guide of simple rules and examples. method that converts a word or string into Pig Latin Let's implement the logic in the Java program to find the Pig Latin word. Note: To make the string Pig Latin there must at least one vowel in the word. For example, Pig Latin of the word nymphly is not possible. The Pig Latin word is not possible if the input word or string contains no vowel. Glove: ovegl = ovegl + ay = oveglay If the Word has no Vowel For example, consider the following words: In such a case, the whole sound ( ay) is added to the end of the word. In other words, the multiple consonants that form one sound are known as consonant clusters. The word that has more than one consonant at the beginning is known as consonant clusters words. For example, consider the following words:Īlways: always + yay = alwaysyay or always + way = alwayswayĮgg: egg + yay = eggyay or egg + way = eggway If the Word Begin with Consonant Clusters Some people also add way or hay or other endings. If the word begins with a vowel, in such cases yay is added at the end of the word. Happy = appyh = appyh + ay = appyhay If the Word Begin with Vowel After that, the suffix ay is added to the word. If the word begins with a consonant, all the alphabets before the vowel is placed at the end of the word.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |