Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Quote Search Program Improvements part A (submit as a separate program). Make the search case InSensitive, i.e. With the current program, the Will and

Python

Quote Search Program Improvements part A (submit as a separate program). Make the search case InSensitive, i.e. With the current program, the "Will" and "will" are searched as two different entities, see examples below. Modify program such, that all occurrences of the searched word will be found regardless of the case, i.e. the search for "will" or "Will" should return results containing all "will", "Will", "WILL"

$ python quote_search.py query:Will Will Found: ...Will you draw me a sheep? ... 
$ python quote_search.py query:will will Found: ...will have the stars as no one else has them...In o ... Found: ...will be content that you have known me. You will a ... Found: ...will hurt each other. But this is the very conditi ... Found: ...will have stars as no one else has them... In one ... Found: ...will have five hundred million little bells, and I ... Found: ...will be unique in all the world. To you, I shall b ... Found: ...will be filled with sunshine. I'll know the sound ... Found: ...will know who he is, If this should happen, please ... 

part B (submit as a separate program). Allow multiple, not joined query terms. See example below, if I search for "this should happen" I get a result, however, if I search for "this happen" I get no results, because the current search implementation searched for exact string match. Modify the program such that each query term separated by the white spaces is searched. Only results containing ALL keywords should be returned

$ python quote_search.py query:this should happen this should happen Found: ...this should happen, please comfort me. Send me wor ... 
$ python quote_search.py query:this happen this happen (base) Gulas-MacBook-Pro:lecture3 gulanurmatova$ 

part C (submit as a separate program). If not results found, print "No results found". in the example above, if no results found, the program does not provide a good feedback to the user, please add a feedback message in the case when no results are found part D (submit as a separate program): Introduce AND and OR operators for at least 2 keywords, ok to limit to only 1 operator (either AND used or OR used, ok if program doesn't work well for combination of both or for more than 2 keywords): a search query "love AND flower" should return only results containing both "love" and "flower": "If you love a flower that lives on a star, it is sweet to look at the sky at night. All the stars are a-bloom with flowers...", "Of course, I love you,' the flower said to him. 'If you were not aware of it, it was my fault." "If you love a flower that lives on a star, then it's good at night, to look up at the sky. All the stars are blossoming." optional (ok if it is returned or not): "If someone loves a flower of which just one exists among all the millions and millions of stars, that's enough to make him happy when he looks at the stars.", a search query "love OR flower" should return results containing either "love" or "flower": optional (ok if it is returned or not): "You see, one loves the sunset when one is so sad." "If you love a flower that lives on a star, it is sweet to look at the sky at night. All the stars are a-bloom with flowers..." "Grown-ups love figures... When you tell them you've made a new friend they never ask you any questions about essential matters. They never say to you \"What does his voice sound like? What games does he love best? Does he collect butterflies? \" Instead they demand \"How old is he? How much does he weigh? How much money does his father make? \" Only from these figures do they think they have learned anything about him." "I was too young to know how to love her." optional (ok if it is returned or not):"I have always loved the desert. One sits down on a desert sand dune, sees nothing, hears nothing. Yet through the silence something throbs, and gleams..." "Of course, I love you,' the flower said to him. 'If you were not aware of it, it was my fault.", optional (ok if it is returned or not):"And the little prince broke into a lovely peal of laughter, which irritated me very much. I like my misfortunes to be taken seriously." "If someone loves a flower of which just one exists among all the millions and millions of stars, that's enough to make him happy when he looks at the stars.", "If you love a flower that lives on a star, then it's good at night, to look up at the sky. All the stars are blossoming." optional (ok if it is returned or not):"For millions of years flowers have been producing thorns. For millions of years sheep have been eating them all the same. And it's not serious, trying to understand why flowers go to such trouble to produce thorns that are good for nothing? It's not important, the war between the sheep and the flowers? It's no more serious and more important than the numbers that fat red gentleman is adding up? Suppose I happen to know a unique flower, one that exists nowhere in the world except on my planet, one that a little sheep can wipe out in a single bite one morning, just like that, without even realizing what he'd doing - that isn't important? If someone loves a flower of which just one example exists among all the millions and millions of stars, that's enough to make him happy when he looks at the stars. He tells himself 'My flower's up there somewhere...' But if the sheep eats the flower, then for him it's as if, suddenly, all the stars went out. And that isn't important?" "You know...my flower...I'm responsible for her. And she's so weak! And so naive. She has four ridiculous thorns to defend her against the world..." part E (submit as a separate program): Analyze the inputs and outputs from the program above, what happens if the user enters same keyword multiple times, ex: "flower AND flower", does your program still search for each one? If yes, modify your program such that it does not search for repeated keywords. Also, ensure that the output quotes are only displayed once, i.e. there should be no repeating quotes in the output. part D (optional, extra credit): research on the concepts of "inverted index", "stop words" and "word stemming and synonym expansion". Think how you could implement them in your program. If you do attempt to implement any of them, submit as a separate program for up to 5 points extra credit (1.5 times the value of homework submission and 0.5 value of a quiz). You will not be quizzed on these concepts, it is a general computer science knowledge.

Load Balancers research (optional, extra credit): research on other implementations for the load balancers routing algorithms, modify the load balancer program we built in class to implement one of those algorithms. Explain in the comments what approach you have chosen. Submit for up to 3.3 points extra credit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions