Write a script that encodes English-language phrases into a form of coded language called pig Latin....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a script that encodes English-language phrases into a form of coded language called pig Latin. There are many different ways to form pig Latin phrases. For simplicity, use the following algorithm: To form a pig Latin phrase from an English-language phrase, tokenize the phrase into words with string method split. To translate each English word into a pig Latin word, place the first letter of the English word at the end of the word and add the letters ay." Thus, the word "jump" becomes "umpjay," the word "the" becomes "hetay," and the word "computer" becomes "omputercay." If the word starts with a vowel, just add "ay." Blanks between words remain as blanks. Assume the following: The English phrase con- sists of words separated by blanks, there are no punctuation marks and all words have two or more letters. Enable the user to enter a sentence, then display the sentence in pig Latin. Write a script that encodes English-language phrases into a form of coded language called pig Latin. There are many different ways to form pig Latin phrases. For simplicity, use the following algorithm: To form a pig Latin phrase from an English-language phrase, tokenize the phrase into words with string method split. To translate each English word into a pig Latin word, place the first letter of the English word at the end of the word and add the letters ay." Thus, the word "jump" becomes "umpjay," the word "the" becomes "hetay," and the word "computer" becomes "omputercay." If the word starts with a vowel, just add "ay." Blanks between words remain as blanks. Assume the following: The English phrase con- sists of words separated by blanks, there are no punctuation marks and all words have two or more letters. Enable the user to enter a sentence, then display the sentence in pig Latin.
Expert Answer:
Answer rating: 100% (QA)
Sure heres a simple Python script that encodes Englishlanguage phrases into ... View the full answer
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date:
Students also viewed these programming questions
-
Lululemon Athletica's share is currently trading at $50, and its market capitalization is $7 million. The firm's beta is 1.5, the risk-free rate is 2.4%, and the market risk premium is 6%. The firm...
-
First, spend a couple of sentences summarizing the Concepts in the article below ? Then, answer the following. In the Concepts in Article, the speaker mentioned, "A stock is fundamentally more...
-
There are many different ways that governments collect taxes. In Zambia alone there are income taxes, taxes on copper and other mining royalties, taxes on property and financial transactions among...
-
Find the area under one arch of the cycloid x = a(t - sin t), y = a(1 - cos t).
-
Two jets of material from the center of a radio galaxy are ejected in opposite directions. Both jets move at 0.750c relative to the galaxy. Determine the speed of one jet relative to the other.
-
The equilibrium constant for the reaction A B is Kc = 10 at a certain temperature. (1) Starting with only reactant A, which of the diagrams shown here best represents the system at equilibrium? (2)...
-
What does a field technician need to be aware of when disconnecting the BNC connector on a proximeter of a loaded, running machine?
-
Arma Company sells equipment on September 30, 2014, for $20,000 cash. The equipment originally cost $72,000 and as of January 1, 2014, had accumulated depreciation of $42,000. Depreciation for the...
-
The following information was obtained from the annual report of A Ltd of the current year. Income statement: Sales 4200 Cost of sales -1680 Other operating expenses -630 Profit before interest and...
-
Iceland has no military. (a) So, at what point in Figure 1.1 is Iceland producing? (b) If Iceland decided to produce the quantity OE of military goods, how much consumer output would it have to give...
-
1. Explain the importance of determining the facts when making a responsible ethical decision. 2. Explain the importance of moral imagination with an example. 3. How does a free and competitive...
-
Which three of the channels are your greatest challenges where you need improvement in encoding nonverbal communication? Make sure to integrate/define the terms you just learned Illustrate each of...
-
can you help me rewrite this simpler way: Funding a program as capital and operating are two different financial approaches, each with its own implications.
-
Cache and Virtual Memory can benefit from thesituations where the same value are accessed. If different value, which would only get the benefit? Cache or Virtual Memory? Why? What is Virtual...
-
Describe a person in your life you believe is an effective listener. What about their verbal and nonverbal behavior signals that they are an effective listener? What can you learn from their...
-
Managers and leaders must possess good communication skills in order to be successful and achieve their goals. However, there are many barriers to effective communication. Please describe five common...
-
7. Which one of the following expressions determines the critical angle for quartz (n = 1.5) immersed in oil (n=1.1)? A) 0 = 1.5/1.1 B) = sin(1.1/1.5) C) = sin (1.1/1.5) D) 8,tan (1.1/1.5)
-
Consider a game of poker being played with a standard 52-card deck (four suits, each of which has 13 different denominations of cards). At a certain point in the game, six cards have been exposed. Of...
-
I. Present reasons why this phase of the SDLC is often the most time consuming and expensive. II. Explain the life cycle does not have a hard ending for a system once this phase has been completed....
-
Which of the following is NOT a stage as described in NISTs SP 800-34, Rev. 1? a. Determine mission/business process and recovery critically. b. Identify resource requirements. c. Identify recovery...
-
I. Justify the facts that organizations that had remote access systems in place were far better equipped to handle the transformation of the workplace that was the result of the pandemic. II....
-
An extremely intriguing feature of quantum entanglement is a property that has been called the "monogamy of entanglement": a particle can only be maximally entangled with precisely one other...
-
We had mentioned that from the partition function \(Z\), all possible thermodynamical quantities can be determined. In this problem, we will use the harmonic oscillator's partition function of Eq....
-
Let's consider the harmonic oscillator immersed in a heat bath of temperature \(T\). For any Hermitian operator \(\hat{A}\), we can define its thermal average denoted as...
Study smarter with the SolutionInn App