Difference: Lab10 (1 vs. 17)

Revision 172016-11-08 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 16, 11:55pm

Line: 31 to 31
 For the basic program turn in the following:

  1. All the code, fully documented
Changed:
<
<
  1. The output of runs with the following searches: Kenyon (should fail), doctor, box, love.
>
>
  1. The output of runs with the following searches: Kenyon (should fail), doctor, boat, crash, love.
 
  1. For each search show the output for the number of matches. (Showing the actually matching paragraphs is considered extra credit, and addressed below)
For the extra credit you must turn in all of the following:

  1. A word or text document clearing describing, in a numbered list, all of the extra credit functions you have added.
  2. A table showing the features and the expected extra credit. For example
    Feature Credit
    1. Search for words 1%
    3. Make search case insensitive 1%
    5. All viewing of matching paragraphs or sentances 1%
    Total 3%
Changed:
<
<
  1. At least one run for each feature clearly demonstrating it's operation.
>
>
  1. At least one run for each feature clearly demonstrating it's operation.

 

Extra credit

Since this is the lass project you will have the opportunity to explore this problem, and add extra credit toward your overall grade. Following are a list of possible options, with a percent of how much it add to your OVERALL grade. You may propose additional improvements for extra credit by emailing me with a proposal, and I will decide if it can be approved, and how much it is worth. The maximum extra credit is 10%.

Line: 122 to 121
 

Processing

Changed:
<
<

C_-_shakespeare.png
>
>

C_-_shakespeare.png
 

Run Example

Added:
>
>
 
Welcome to the Shakespeare search program
Books (# of paragraphs)
1.  THE SONNETS (155)

Line: 601 to 601
 
Changed:
<
<
META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1449757531" name="Shakespeare.txt" path="Shakespeare.txt" size="5465289" user="JimSkon" version="2"
>
>
META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1478585072" name="Shakespeare.txt" path="Shakespeare.txt" size="5465289" user="JimSkon" version="2"
 
META FILEATTACHMENT attachment="C_-_shakespeare.png" attr="" comment="" date="1449108089" name="C_-_shakespeare.png" path="C_-_shakespeare.png" size="19227" user="JimSkon" version="1"

Revision 162015-12-17 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 16, 11:55pm

Line: 57 to 57
 
  1. (1%) Add support to search for words within some specified numbers of word apart.
  2. (2%) Add Stemming (see instructor if you wish to try this)
  3. You propose your own!!
Changed:
<
<

The Class Definitations

>
>

The Class definitions

  %CODE{"c++"}% class paragraph {

Revision 152015-12-17 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 16, 11:55pm

Line: 31 to 31
 For the basic program turn in the following:

  1. All the code, fully documented
Changed:
<
<
  1. A run with the following searches: Kenyon (should fail), doctor, box, love.
  2. For each search show the output for the number of matches. (Showing the actualy matching paragraphs is considered extra credit, and addressed below)
>
>
  1. The output of runs with the following searches: Kenyon (should fail), doctor, box, love.
  2. For each search show the output for the number of matches. (Showing the actually matching paragraphs is considered extra credit, and addressed below)
 For the extra credit you must turn in all of the following:

  1. A word or text document clearing describing, in a numbered list, all of the extra credit functions you have added.
Changed:
<
<
  1. A table showing the features and the expected extra credit. Example
    Feature Credit
    1. Search for words 1%
    3. Make search case insensitive 1%
    5. All viewing of matching paragraphs or sentances 1%
    Total 3%
>
>
  1. A table showing the features and the expected extra credit. For example
    Feature Credit
    1. Search for words 1%
    3. Make search case insensitive 1%
    5. All viewing of matching paragraphs or sentances 1%
    Total 3%
 
  1. At least one run for each feature clearly demonstrating it's operation.

Extra credit

Revision 142015-12-14 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 16, 11:55pm

Line: 32 to 32
 
  1. All the code, fully documented
  2. A run with the following searches: Kenyon (should fail), doctor, box, love.
Changed:
<
<
  1. For each search show all the output.
>
>
  1. For each search show the output for the number of matches. (Showing the actualy matching paragraphs is considered extra credit, and addressed below)
 For the extra credit you must turn in all of the following:

  1. A word or text document clearing describing, in a numbered list, all of the extra credit functions you have added.
Line: 122 to 122
 

Processing

Changed:
<
<

C_-_shakespeare.png
>
>

C_-_shakespeare.png
 

Run Example

Welcome to the Shakespeare search program

Revision 132015-12-14 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 16, 11:55pm

Line: 20 to 20
  A complete version of all works of Shakespeare in a single file is available here: Shakespeare.txt.
Changed:
<
<
Your program must do at least the following:
>
>
Your program must do at least the following:
 
  1. Read in the entire file of Shakespeare books, and parse it into Books and Paragraphs, where Books is object the contains an entire book (definition below), and Paragraph is an object representation of a paragraph (also below). Thus there will be an array of Books, and each book will be a title plus an array of paragraphs.
  2. Show the user a list of the book titles, alone with the number of paragraphs found in each.
  3. Ask the user for a word to search, and show the users how many paragraphs in each book has a match for this word.
  4. Repeat the above step until the user is done.
Added:
>
>

What to turn in

For the basic program turn in the following:

  1. All the code, fully documented
  2. A run with the following searches: Kenyon (should fail), doctor, box, love.
  3. For each search show all the output.
For the extra credit you must turn in all of the following:

  1. A word or text document clearing describing, in a numbered list, all of the extra credit functions you have added.
  2. A table showing the features and the expected extra credit. Example
    Feature Credit
    1. Search for words 1%
    3. Make search case insensitive 1%
    5. All viewing of matching paragraphs or sentances 1%
    Total 3%
  3. At least one run for each feature clearly demonstrating it's operation.
 

Extra credit

Changed:
<
<
Since this is the lass project you will have the opportunity to explore this problem, and add extra credit toward your overall grade. Following are a list of possible options, with a percent of how much it add to your OVERALL grade. You may propose additional improvements for extra credit by emailing me with a proposal, and I will decide if it can be approved, and how much it is worth. The maximum extra credit is 10%.
>
>
Since this is the lass project you will have the opportunity to explore this problem, and add extra credit toward your overall grade. Following are a list of possible options, with a percent of how much it add to your OVERALL grade. You may propose additional improvements for extra credit by emailing me with a proposal, and I will decide if it can be approved, and how much it is worth. The maximum extra credit is 10%.
  Some options:
Changed:
<
<
  1. (0.5%) Highlight the matching words (bold or color)
>
>
  1. (1%) Make search match only matching words e.g. a space or "(" before, and one of the following after: . " ' ? ! : ; ) -
  2. (1%) Highlight the matching words (bold or color)
 
  1. (1%) Make searches case insensitive (so searching for "king" matches "king", "King", and "KING", for example.
  2. (1%) Add an option to show the matching paragraphs from a selected book (shown in the example below).
  3. (1%) Choose whether to see matching paragraph or just sentences.
  4. (1%) Add support for a second author or set of works. The second file must be at least 1Mb, and you will need to format it appropriately. You will have two programs, one for Shakespeare, and another for the new file.
Changed:
<
<
  1. (2%) Add support for 5 or more authors, and start with a menu listing the options, and allowing the user to select the works, then to the other operations. This option is mutually exclusive with #2.
  2. (1%) Add support to #3 to search ALL books.
  3. (2%) Add support to #1 & #2 to search for pairs of words, not necessarily adjacent.
  4. (1%) Add support to #5 to search for words within some specified numbers of word apart.
  5. (2%) Add Stemming.
  6. More to come ...
>
>
  1. (2%) Add support for 5 or more authors, and start with a menu listing the options, and allowing the user to select the works, then on to the other operations.
  2. (1%) Add support to #7 to search ALL books.
  3. (2%) Add support to #1 to search for pairs of words, not necessarily adjacent.
  4. (1%) Add support to search for words within some specified numbers of word apart.
  5. (2%) Add Stemming (see instructor if you wish to try this)
  6. You propose your own!!
 

The Class Definitations

%CODE{"c++"}%
Line: 108 to 122
 

Processing

Changed:
<
<

C_-_shakespeare.png
>
>

C_-_shakespeare.png
 

Run Example

Welcome to the Shakespeare search program

Revision 122015-12-11 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Changed:
<
<

Due: Dec 14, 11:55pm

>
>

Due: Dec 16, 11:55pm

 

Instructions

  • Turn in the code (a cpp file or ideone.com link), and the run outputs as requested below.
  • Remember to format the code as described and the book and text, and to include comments including complete commetns at the beginning of the program.
Line: 108 to 108
 

Processing

Changed:
<
<

C_-_shakespeare.png
>
>

C_-_shakespeare.png
 

Run Example

Welcome to the Shakespeare search program

Revision 112015-12-11 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 14, 11:55pm

Line: 75 to 75
  %CODE{"c++"}%
Changed:
<
<
tring readParagraph( istream& is )
>
>
string readParagraph( istream& is )
 { string line; string paragraph; int lineNum = 0;;
Changed:
<
<
do {
>
>
//scan for the next paragraph do {
  getline( is , line );
Changed:
<
<
if (line.length() > 2 && lineNum++ > 0) {
>
>
} while (line.length() == 0 && is.eof());

// return nothing if eof if (is.eof()) { return ""; } // Get the next paragraph do { // Only put a newline after first line if (lineNum++ > 0) {

  paragraph += "\n"; } paragraph += line;
Changed:
<
<
} while( line.length() > 2 && is.fail());
>
>
getline(is, line); } while (line.length() > 0 && is.eof());
  return paragraph; }
Line: 100 to 108
 

Processing

Changed:
<
<

C_-_shakespeare.png
>
>

C_-_shakespeare.png
 

Run Example

Welcome to the Shakespeare search program
Books (# of paragraphs)

Changed:
<
<
1. THE SONNETS (311) 2. ALLS WELL THAT ENDS WELL (233) 3. THE TRAGEDY OF ANTONY AND CLEOPATRA (313) 4. AS YOU LIKE IT (243) 5. THE COMEDY OF ERRORS (149) 6. THE TRAGEDY OF CORIOLANUS (331) 7. CYMBELINE (290) 8. THE TRAGEDY OF HAMLET, PRINCE OF DENMARK (313) 9. THE FIRST PART OF KING HENRY THE FOURTH (237) 10. SECOND PART OF KING HENRY IV (259) 11. THE LIFE OF KING HENRY THE FIFTH (279) 12. THE FIRST PART OF HENRY THE SIXTH (312) 13. THE SECOND PART OF KING HENRY THE SIXTH (287) 14. THE THIRD PART OF KING HENRY THE SIXTH (285) 15. KING HENRY THE EIGHTH (233) 16. KING JOHN (198) 17. THE TRAGEDY OF JULIUS CAESAR (211) 18. THE TRAGEDY OF KING LEAR (310) 19. LOVE'S LABOUR'S LOST (144) 20. THE TRAGEDY OF MACBETH (506) 21. THE MERCHANT OF VENICE (203) 22. THE MERRY WIVES OF WINDSOR (308) 23. A MIDSUMMER NIGHT'S DREAM (172) 24. MUCH ADO ABOUT NOTHING (197) 25. THE TRAGEDY OF OTHELLO, MOOR OF VENICE (223) 26. KING RICHARD THE SECOND (212) 27. KING RICHARD III (344) 28. THE TRAGEDY OF ROMEO AND JULIET (294) 29. THE TAMING OF THE SHREW (213) 30. THE TEMPEST (165) 31. THE LIFE OF TIMON OF ATHENS (226) 32. THE TRAGEDY OF TITUS ANDRONICUS (195) 33. THE HISTORY OF TROILUS AND CRESSIDA (306) 34. TWELFTH NIGHT; OR, WHAT YOU WILL (245) 35. THE TWO GENTLEMEN OF VERONA (200) 36. THE WINTER'S TALE (184) 37. A LOVER'S COMPLAINT (50) Number of Books: 37
>
>
1. THE SONNETS (155) 2. ALLS WELL THAT ENDS WELL (150) 3. THE TRAGEDY OF ANTONY AND CLEOPATRA (271) 4. AS YOU LIKE IT (165) 5. THE COMEDY OF ERRORS (111) 6. THE TRAGEDY OF CORIOLANUS (231) 7. CYMBELINE (197) 8. THE TRAGEDY OF HAMLET, PRINCE OF DENMARK (234) 9. THE FIRST PART OF KING HENRY THE FOURTH (166) 10. SECOND PART OF KING HENRY IV (189) 11. THE LIFE OF KING HENRY THE FIFTH (183) 12. THE FIRST PART OF HENRY THE SIXTH (220) 13. THE SECOND PART OF KING HENRY THE SIXTH (201) 14. THE THIRD PART OF KING HENRY THE SIXTH (187) 15. KING HENRY THE EIGHTH (170) 16. KING JOHN (136) 17. THE TRAGEDY OF JULIUS CAESAR (143) 18. THE TRAGEDY OF KING LEAR (220) 19. LOVE'S LABOUR'S LOST (103) 20. THE TRAGEDY OF MACBETH (189) 21. MEASURE FOR MEASURE (146) 22. THE MERCHANT OF VENICE (133) 23. THE MERRY WIVES OF WINDSOR (220) 24. A MIDSUMMER NIGHT'S DREAM (132) 25. MUCH ADO ABOUT NOTHING (132) 26. THE TRAGEDY OF OTHELLO, MOOR OF VENICE (165) 27. KING RICHARD THE SECOND (142) 28. KING RICHARD III (256) 29. THE TRAGEDY OF ROMEO AND JULIET (205) 30. THE TAMING OF THE SHREW (165) 31. THE TEMPEST (122) 32. THE LIFE OF TIMON OF ATHENS (162) 33. THE TRAGEDY OF TITUS ANDRONICUS (140) 34. THE HISTORY OF TROILUS AND CRESSIDA (223) 35. TWELFTH NIGHT; OR, WHAT YOU WILL (177) 36. THE TWO GENTLEMEN OF VERONA (127) 37. THE WINTER'S TALE (127) 38. A LOVER'S COMPLAINT (48) Number of Books: 38
  Word to search for:sail 1. THE SONNETS has 5 matches.
Line: 162 to 171
 17. THE TRAGEDY OF JULIUS CAESAR has 1 matches. 19. LOVE'S LABOUR'S LOST has 2 matches. 20. THE TRAGEDY OF MACBETH has 3 matches.
Changed:
<
<
21. THE MERCHANT OF VENICE has 6 matches. 22. THE MERRY WIVES OF WINDSOR has 1 matches. 23. A MIDSUMMER NIGHT'S DREAM has 2 matches. 24. MUCH ADO ABOUT NOTHING has 1 matches. 25. THE TRAGEDY OF OTHELLO, MOOR OF VENICE has 9 matches. 26. KING RICHARD THE SECOND has 1 matches. 27. KING RICHARD III has 3 matches. 28. THE TRAGEDY OF ROMEO AND JULIET has 4 matches. 29. THE TAMING OF THE SHREW has 1 matches. 30. THE TEMPEST has 8 matches. 33. THE HISTORY OF TROILUS AND CRESSIDA has 5 matches. 34. TWELFTH NIGHT; OR, WHAT YOU WILL has 5 matches. 37. A LOVER'S COMPLAINT has 1 matches.
>
>
22. THE MERCHANT OF VENICE has 6 matches. 23. THE MERRY WIVES OF WINDSOR has 1 matches. 24. A MIDSUMMER NIGHT'S DREAM has 2 matches. 25. MUCH ADO ABOUT NOTHING has 1 matches. 26. THE TRAGEDY OF OTHELLO, MOOR OF VENICE has 9 matches. 27. KING RICHARD THE SECOND has 1 matches. 28. KING RICHARD III has 3 matches. 29. THE TRAGEDY OF ROMEO AND JULIET has 4 matches. 30. THE TAMING OF THE SHREW has 1 matches. 31. THE TEMPEST has 8 matches. 34. THE HISTORY OF TROILUS AND CRESSIDA has 5 matches. 35. TWELFTH NIGHT; OR, WHAT YOU WILL has 5 matches. 38. A LOVER'S COMPLAINT has 1 matches.
 Enter book number to view matches, 0 for a new search, -1 to end: 29
Changed:
<
<
Matches of "sail" in book " THE TAMING OF THE SHREW"

TRANIO. Sir, what are you that offer to beat my servant? VINCENTIO. What am I, sir? Nay, what are you, sir? O immortal gods! O fine villain! A silken doublet, a velvet hose, a scarlet cloak, and a copatain hat! O, I am undone! I am undone! While I play the good husband at home, my son and my servant spend all at the university. TRANIO. How now! what's the matter? BAPTISTA. What, is the man lunatic? TRANIO. Sir, you seem a sober ancient gentleman by your habit, but your words show you a madman. Why, sir, what 'cerns it you if I wear pearl and gold? I thank my good father, I am able to maintain it. VINCENTIO. Thy father! O villain! he is a sailmaker in Bergamo. BAPTISTA. You mistake, sir; you mistake, sir. Pray, what do you think is his name? VINCENTIO. His name! As if I knew not his name! I have brought him up ever since he was three years old, and his name is Tranio. PEDANT. Away, away, mad ass! His name is Lucentio; and he is mine only son, and heir to the lands of me, Signior Vicentio. VINCENTIO. Lucentio! O, he hath murd'red his master! Lay hold on him, I charge you, in the Duke's name. O, my son, my son! Tell me, thou villain, where is my son, Lucentio? TRANIO. Call forth an officer.

>
>
Matches of "sail" in book " THE TRAGEDY OF ROMEO AND JULIET"
 
Added:
>
>
Ben. See, where he comes. So please you step aside, I'll know his grievance, or be much denied. Mon. I would thou wert so happy by thy stay To hear true shrift. Come, madam, let's away, Exeunt [Montague and Wife]. Ben. Good morrow, cousin. Rom. Is the day so young? Ben. But new struck nine. Rom. Ay me! sad hours seem long. Was that my father that went hence so fast? Ben. It was. What sadness lengthens Romeo's hours? Rom. Not having that which having makes them short. Ben. In love? Rom. Out- Ben. Of love? Rom. Out of her favour where I am in love. Ben. Alas that love, so gentle in his view, Should be so tyrannous and rough in proof! Rom. Alas that love, whose view is muffled still, Should without eyes see pathways to his will! Where shall we dine? O me! What fray was here? Yet tell me not, for I have heard it all. Here's much to do with hate, but more with love. Why then, O brawling love! O loving hate! O anything, of nothing first create! O heavy lightness! serious vanity! Misshapen chaos of well-seeming forms! Feather of lead, bright smoke, cold fire, sick health! Still-waking sleep, that is not what it is This love feel I, that feel no love in this. Dost thou not laugh? Ben. No, coz, I rather weep. Rom. Good heart, at what? Ben. At thy good heart's oppression. Rom. Why, such is love's transgression. Griefs of mine own lie heavy in my breast, Which thou wilt propagate, to have it prest With more of thine. This love that thou hast shown Doth add more grief to too much of mine own. Love is a smoke rais'd with the fume of sighs; Being purg'd, a fire sparkling in lovers' eyes; Being vex'd, a sea nourish'd with lovers' tears. What is it else? A madness most discreet, A choking gall, and a preserving sweet. Farewell, my coz. Ben. Soft! I will go along. An if you leave me so, you do me wrong. Rom. Tut! I have lost myself; I am not here: This is not Romeo, he's some other where. Ben. Tell me in sadness, who is that you love? Rom. What, shall I groan and tell thee? Ben. Groan? Why, no; But sadly tell me who. Rom. Bid a sick man in sadness make his will. Ah, word ill urg'd to one that is so ill! In sadness, cousin, I do love a woman. Ben. I aim'd so near when I suppos'd you lov'd. Rom. A right good markman! And she's fair I love. Ben. A right fair mark, fair coz, is soonest hit. Rom. Well, in that hit you miss. She'll not be hit With Cupid's arrow. She hath Dian's wit, And, in strong proof of chastity well arm'd, From Love's weak childish bow she lives unharm'd. She will not stay the siege of loving terms, Nor bide th' encounter of assailing eyes, Nor ope her lap to saint-seducing gold. O, she's rich in beauty; only poor That, when she dies, with beauty dies her store. Ben. Then she hath sworn that she will still live chaste? Rom. She hath, and in that sparing makes huge waste; For beauty, starv'd with her severity, Cuts beauty off from all posterity. She is too fair, too wise, wisely too fair, To merit bliss by making me despair. She hath forsworn to love, and in that vow Do I live dead that live to tell it now. Ben. Be rul'd by me: forget to think of her. Rom. O, teach me how I should forget to think! Ben. By giving liberty unto thine eyes. Examine other beauties. Rom. 'Tis the way To call hers (exquisite) in question more. These happy masks that kiss fair ladies' brows, Being black puts us in mind they hide the fair. He that is strucken blind cannot forget The precious treasure of his eyesight lost. Show me a mistress that is passing fair, What doth her beauty serve but as a note Where I may read who pass'd that passing fair? Farewell. Thou canst not teach me to forget. Ben. I'll pay that doctrine, or else die in debt. Exeunt.

Rom. What, shall this speech be spoke for our excuse? Or shall we on without apology? Ben. The date is out of such prolixity. We'll have no Cupid hoodwink'd with a scarf, Bearing a Tartar's painted bow of lath, Scaring the ladies like a crowkeeper; Nor no without-book prologue, faintly spoke After the prompter, for our entrance; But, let them measure us by what they will, We'll measure them a measure, and be gone. Rom. Give me a torch. I am not for this ambling. Being but heavy, I will bear the light. Mer. Nay, gentle Romeo, we must have you dance. Rom. Not I, believe me. You have dancing shoes With nimble soles; I have a soul of lead So stakes me to the ground I cannot move. Mer. You are a lover. Borrow Cupid's wings And soar with them above a common bound. Rom. I am too sore enpierced with his shaft To soar with his light feathers; and so bound I cannot bound a pitch above dull woe. Under love's heavy burthen do I sink. Mer. And, to sink in it, should you burthen love- Too great oppression for a tender thing. Rom. Is love a tender thing? It is too rough, Too rude, too boist'rous, and it pricks like thorn. Mer. If love be rough with you, be rough with love. Prick love for pricking, and you beat love down. Give me a case to put my visage in. A visor for a visor! What care I What curious eye doth quote deformities? Here are the beetle brows shall blush for me. Ben. Come, knock and enter; and no sooner in But every man betake him to his legs. Rom. A torch for me! Let wantons light of heart Tickle the senseless rushes with their heels; For I am proverb'd with a grandsire phrase, I'll be a candle-holder and look on; The game was ne'er so fair, and I am done. Mer. Tut! dun's the mouse, the constable's own word! If thou art Dun, we'll draw thee from the mire Of this sir-reverence love, wherein thou stick'st Up to the ears. Come, we burn daylight, ho! Rom. Nay, that's not so. Mer. I mean, sir, in delay We waste our lights in vain, like lamps by day. Take our good meaning, for our judgment sits Five times in that ere once in our five wits. Rom. And we mean well, in going to this masque; But 'tis no wit to go. Mer. Why, may one ask? Rom. I dreamt a dream to-night. Mer. And so did I. Rom. Well, what was yours? Mer. That dreamers often lie. Rom. In bed asleep, while they do dream things true. Mer. O, then I see Queen Mab hath been with you. She is the fairies' midwife, and she comes In shape no bigger than an agate stone On the forefinger of an alderman, Drawn with a team of little atomies Athwart men's noses as they lie asleep; Her wagon spokes made of long spinners' legs, The cover, of the wings of grasshoppers; Her traces, of the smallest spider's web; Her collars, of the moonshine's wat'ry beams; Her whip, of cricket's bone; the lash, of film; Her wagoner, a small grey-coated gnat, Not half so big as a round little worm Prick'd from the lazy finger of a maid; Her chariot is an empty hazelnut, Made by the joiner squirrel or old grub, Time out o' mind the fairies' coachmakers. And in this state she 'gallops night by night Through lovers' brains, and then they dream of love; O'er courtiers' knees, that dream on cursies straight; O'er lawyers' fingers, who straight dream on fees; O'er ladies' lips, who straight on kisses dream, Which oft the angry Mab with blisters plagues, Because their breaths with sweetmeats tainted are. Sometime she gallops o'er a courtier's nose, And then dreams he of smelling out a suit; And sometime comes she with a tithe-pig's tail Tickling a parson's nose as 'a lies asleep, Then dreams he of another benefice. Sometimes she driveth o'er a soldier's neck, And then dreams he of cutting foreign throats, Of breaches, ambuscadoes, Spanish blades, Of healths five fadom deep; and then anon Drums in his ear, at which he starts and wakes, And being thus frighted, swears a prayer or two And sleeps again. This is that very Mab That plats the manes of horses in the night And bakes the elflocks in foul sluttish, hairs, Which once untangled much misfortune bodes This is the hag, when maids lie on their backs, That presses them and learns them first to bear, Making them women of good carriage. This is she- Rom. Peace, peace, Mercutio, peace! Thou talk'st of nothing. Mer. True, I talk of dreams; Which are the children of an idle brain, Begot of nothing but vain fantasy; Which is as thin of substance as the air, And more inconstant than the wind, who wooes Even now the frozen bosom of the North And, being anger'd, puffs away from thence, Turning his face to the dew-dropping South. Ben. This wind you talk of blows us from ourselves. Supper is done, and we shall come too late. Rom. I fear, too early; for my mind misgives Some consequence, yet hanging in the stars, Shall bitterly begin his fearful date With this night's revels and expire the term Of a despised life, clos'd in my breast, By some vile forfeit of untimely death. But he that hath the steerage of my course Direct my sail! On, lusty gentlemen! Ben. Strike, drum. They march about the stage. [Exeunt.]

But soft! What light through yonder window breaks? It is the East, and Juliet is the sun! Arise, fair sun, and kill the envious moon, Who is already sick and pale with grief That thou her maid art far more fair than she. Be not her maid, since she is envious. Her vestal livery is but sick and green, And none but fools do wear it. Cast it off. It is my lady; O, it is my love! O that she knew she were! She speaks, yet she says nothing. What of that? Her eye discourses; I will answer it. I am too bold; 'tis not to me she speaks. Two of the fairest stars in all the heaven, Having some business, do entreat her eyes To twinkle in their spheres till they return. What if her eyes were there, they in her head? The brightness of her cheek would shame those stars As daylight doth a lamp; her eyes in heaven Would through the airy region stream so bright That birds would sing and think it were not night. See how she leans her cheek upon her hand! O that I were a glove upon that hand, That I might touch that cheek! Jul. Ay me! Rom. She speaks. O, speak again, bright angel! for thou art As glorious to this night, being o'er my head, As is a winged messenger of heaven Unto the white-upturned wond'ring eyes Of mortals that fall back to gaze on him When he bestrides the lazy-pacing clouds And sails upon the bosom of the air. Jul. O Romeo, Romeo! wherefore art thou Romeo? Deny thy father and refuse thy name! Or, if thou wilt not, be but sworn my love, And I'll no longer be a Capulet. Rom. [aside] Shall I hear more, or shall I speak at this? Jul. 'Tis but thy name that is my enemy. Thou art thyself, though not a Montague. What's Montague? it is nor hand, nor foot, Nor arm, nor face, nor any other part Belonging to a man. O, be some other name! What's in a name? That which we call a rose By any other name would smell as sweet. So Romeo would, were he not Romeo call'd, Retain that dear perfection which he owes Without that title. Romeo, doff thy name; And for that name, which is no part of thee, Take all myself. Rom. I take thee at thy word. Call me but love, and I'll be new baptiz'd; Henceforth I never will be Romeo. Jul. What man art thou that, thus bescreen'd in night, So stumblest on my counsel? Rom. By a name I know not how to tell thee who I am. My name, dear saint, is hateful to myself, Because it is an enemy to thee. Had I it written, I would tear the word. Jul. My ears have yet not drunk a hundred words Of that tongue's utterance, yet I know the sound. Art thou not Romeo, and a Montague? Rom. Neither, fair saint, if either thee dislike. Jul. How cam'st thou hither, tell me, and wherefore? The orchard walls are high and hard to climb, And the place death, considering who thou art, If any of my kinsmen find thee here. Rom. With love's light wings did I o'erperch these walls; For stony limits cannot hold love out, And what love can do, that dares love attempt. Therefore thy kinsmen are no let to me. Jul. If they do see thee, they will murther thee. Rom. Alack, there lies more peril in thine eye Than twenty of their swords! Look thou but sweet, And I am proof against their enmity. Jul. I would not for the world they saw thee here. Rom. I have night's cloak to hide me from their sight; And but thou love me, let them find me here. My life were better ended by their hate Than death prorogued, wanting of thy love. Jul. By whose direction found'st thou out this place? Rom. By love, that first did prompt me to enquire. He lent me counsel, and I lent him eyes. I am no pilot; yet, wert thou as far As that vast shore wash'd with the farthest sea, I would adventure for such merchandise. Jul. Thou knowest the mask of night is on my face; Else would a maiden blush bepaint my cheek For that which thou hast heard me speak to-night. Fain would I dwell on form- fain, fain deny What I have spoke; but farewell compliment! Dost thou love me, I know thou wilt say 'Ay'; And I will take thy word. Yet, if thou swear'st, Thou mayst prove false. At lovers' perjuries, They say Jove laughs. O gentle Romeo, If thou dost love, pronounce it faithfully. Or if thou thinkest I am too quickly won, I'll frown, and be perverse, and say thee nay, So thou wilt woo; but else, not for the world. In truth, fair Montague, I am too fond, And therefore thou mayst think my haviour light; But trust me, gentleman, I'll prove more true Than those that have more cunning to be strange. I should have been more strange, I must confess, But that thou overheard'st, ere I was ware, My true-love passion. Therefore pardon me, And not impute this yielding to light love, Which the dark night hath so discovered. Rom. Lady, by yonder blessed moon I swear, That tips with silver all these fruit-tree tops- Jul. O, swear not by the moon, th' inconstant moon, That monthly changes in her circled orb, Lest that thy love prove likewise variable. Rom. What shall I swear by? Jul. Do not swear at all; Or if thou wilt, swear by thy gracious self, Which is the god of my idolatry, And I'll believe thee. Rom. If my heart's dear love- Jul. Well, do not swear. Although I joy in thee, I have no joy of this contract to-night. It is too rash, too unadvis'd, too sudden; Too like the lightning, which doth cease to be Ere one can say 'It lightens.' Sweet, good night! This bud of love, by summer's ripening breath, May prove a beauteous flow'r when next we meet. Good night, good night! As sweet repose and rest Come to thy heart as that within my breast! Rom. O, wilt thou leave me so unsatisfied? Jul. What satisfaction canst thou have to-night? Rom. Th' exchange of thy love's faithful vow for mine. Jul. I gave thee mine before thou didst request it; And yet I would it were to give again. Rom. Would'st thou withdraw it? For what purpose, love? Jul. But to be frank and give it thee again. And yet I wish but for the thing I have. My bounty is as boundless as the sea, My love as deep; the more I give to thee, The more I have, for both are infinite. I hear some noise within. Dear love, adieu! [Nurse] calls within. Anon, good nurse! Sweet Montague, be true. Stay but a little, I will come again. [Exit.] Rom. O blessed, blessed night! I am afeard, Being in night, all this is but a dream, Too flattering-sweet to be substantial.

Mer. A sail, a sail! Ben. Two, two! a shirt and a smock. Nurse. Peter! Peter. Anon. Nurse. My fan, Peter. Mer. Good Peter, to hide her face; for her fan's the fairer face of the two. Nurse. God ye good morrow, gentlemen. Mer. God ye good-den, fair gentlewoman. Nurse. Is it good-den? Mer. 'Tis no less, I tell ye; for the bawdy hand of the dial is now upon the prick of noon. Nurse. Out upon you! What a man are you! Rom. One, gentlewoman, that God hath made for himself to mar. Nurse. By my troth, it is well said. 'For himself to mar,' quoth 'a? Gentlemen, can any of you tell me where I may find the young Romeo? Rom. I can tell you; but young Romeo will be older when you have found him than he was when you sought him. I am the youngest of that name, for fault of a worse. Nurse. You say well. Mer. Yea, is the worst well? Very well took, i' faith! wisely, wisely. Nurse. If you be he, sir, I desire some confidence with you. Ben. She will endite him to some supper. Mer. A bawd, a bawd, a bawd! So ho! Rom. What hast thou found? Mer. No hare, sir; unless a hare, sir, in a lenten pie, that is something stale and hoar ere it be spent He walks by them and sings.

  Enter book number to view matches, 0 for a new search, -1 to end:
Added:
>
>
 

Revision 102015-12-10 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 14, 11:55pm

Line: 206 to 206
 Enter book number to view matches, 0 for a new search, -1 to end:
Changed:
<
<
META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1447783897" name="Shakespeare.txt" path="Shakespeare.txt" size="5465307" user="JimSkon" version="1"
>
>

META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1449757531" name="Shakespeare.txt" path="Shakespeare.txt" size="5465289" user="JimSkon" version="2"
 
META FILEATTACHMENT attachment="C_-_shakespeare.png" attr="" comment="" date="1449108089" name="C_-_shakespeare.png" path="C_-_shakespeare.png" size="19227" user="JimSkon" version="1"

Revision 92015-12-09 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 14, 11:55pm

Line: 33 to 33
 Some options:

  1. (0.5%) Highlight the matching words (bold or color)
Added:
>
>
  1. (1%) Make searches case insensitive (so searching for "king" matches "king", "King", and "KING", for example.
 
  1. (1%) Add an option to show the matching paragraphs from a selected book (shown in the example below).
  2. (1%) Choose whether to see matching paragraph or just sentences.
  3. (1%) Add support for a second author or set of works. The second file must be at least 1Mb, and you will need to format it appropriately. You will have two programs, one for Shakespeare, and another for the new file.
Line: 74 to 75
  %CODE{"c++"}%
Changed:
<
<
string readParagraph( istream& is )
>
>
tring readParagraph( istream& is )
 { string line; string paragraph;
Line: 83 to 84
  do { getline( is , line );
Changed:
<
<
if (lineNum++ > 0) {
>
>
if (line.length() > 2 && lineNum++ > 0) {
  paragraph += "\n"; } paragraph += line;
Changed:
<
<
} while( line.length() > 2);
>
>
} while( line.length() > 2 && is.fail());
  return paragraph; }

Revision 82015-12-03 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Final Project

Due: Dec 14, 11:55pm

Line: 83 to 83
  do { getline( is , line );
Changed:
<
<
if (lineNum++ > 1) {
>
>
if (lineNum++ > 0) {
  paragraph += "\n"; } paragraph += line;
Line: 98 to 98
 The program should have a vector of book.

Processing

Changed:
<
<

C_-_shakespeare.png
>
>

C_-_shakespeare.png
 

Run Example

Welcome to the Shakespeare search program

Revision 72015-12-03 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Lab 10

>
>

Final Project

 

Due: Dec 14, 11:55pm

Instructions

  • Turn in the code (a cpp file or ideone.com link), and the run outputs as requested below.
Line: 95 to 94
 }

%ENDCODE%

Added:
>
>
 The program should have a vector of book.
Added:
>
>

Processing


C_-_shakespeare.png
 

Run Example

Welcome to the Shakespeare search program
Books (# of paragraphs)

Line: 198 to 202
 

Enter book number to view matches, 0 for a new search, -1 to end:

Deleted:
<
<
 
Deleted:
<
<

  • C_-_shakespeare.png:
    C_-_shakespeare.png
 
META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1447783897" name="Shakespeare.txt" path="Shakespeare.txt" size="5465307" user="JimSkon" version="1"
META FILEATTACHMENT attachment="C_-_shakespeare.png" attr="" comment="" date="1449108089" name="C_-_shakespeare.png" path="C_-_shakespeare.png" size="19227" user="JimSkon" version="1"

Revision 62015-12-03 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 10

Due: Dec 14, 11:55pm

Line: 202 to 202
 
Added:
>
>
  • C_-_shakespeare.png:
    C_-_shakespeare.png
 
META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1447783897" name="Shakespeare.txt" path="Shakespeare.txt" size="5465307" user="JimSkon" version="1"
Added:
>
>
META FILEATTACHMENT attachment="C_-_shakespeare.png" attr="" comment="" date="1449108089" name="C_-_shakespeare.png" path="C_-_shakespeare.png" size="19227" user="JimSkon" version="1"

Revision 52015-11-19 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 10

Due: Dec 14, 11:55pm

Line: 72 to 72
  %ENDCODE%
Added:
>
>
<-- SyntaxHighlightingPlugin -->
string readParagraph( istream& is )
{
    string line;
    string paragraph;
    int lineNum = 0;;

    do
    {
        getline( is , line );
        if (lineNum++ > 1) {
            paragraph += "\n";
        }
        paragraph += line;

    } while( line.length() >  2);

    return paragraph;
}

 
<-- end SyntaxHighlightingPlugin -->
 The program should have a vector of book.

Run Example

Welcome to the Shakespeare search program

Revision 42015-11-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 10

Due: Dec 14, 11:55pm

Line: 12 to 12
 
Code Format (Indenting, variable names) 10%
Code Comments 10%
Turning in the run the requested inputs below.. 10%
Changed:
<
<
Turn in a list of extra features added, with a totle of points being sought  
>
>
Turn in a list of extra features added, with a total of points being sought  
 

Problem

Shakespeare Word Search

Revision 32015-11-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 10

Due: Dec 14, 11:55pm

Line: 12 to 12
 
Code Format (Indenting, variable names) 10%
Code Comments 10%
Turning in the run the requested inputs below.. 10%
Added:
>
>
Turn in a list of extra features added, with a totle of points being sought  
 

Problem

Shakespeare Word Search

Revision 22015-11-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 10

Changed:
<
<

Due: Dec 10, 11:55pm

>
>

Due: Dec 14, 11:55pm

 

Instructions

  • Turn in the code (a cpp file or ideone.com link), and the run outputs as requested below.
  • Remember to format the code as described and the book and text, and to include comments including complete commetns at the beginning of the program.
Line: 17 to 17
  Your goal is to use Object Oriented techniques to read the complete works of Shakespeare from a file, and allow for word searches.
Changed:
<
<
A complete version of all works of Shakespeare in a single file is preseanted here.
>
>
A complete version of all works of Shakespeare in a single file is available here: Shakespeare.txt.
  Your program must do at least the following:
Line: 27 to 27
 
  1. Repeat the above step until the user is done.

Extra credit

Changed:
<
<
Since this is the lass project you will have the opportunity to explore this problem, and add extra credit toward your overall grade. Following are a list of possible options, with a percent of how much it add to your OVERALL grade. You may propose additional improvements for extra credit by emailing me with a proposal, and I will decide if it can be approved, and how much it is worth.
>
>
Since this is the lass project you will have the opportunity to explore this problem, and add extra credit toward your overall grade. Following are a list of possible options, with a percent of how much it add to your OVERALL grade. You may propose additional improvements for extra credit by emailing me with a proposal, and I will decide if it can be approved, and how much it is worth. The maximum extra credit is 10%.
  Some options:
Changed:
<
<
  1. (1%) Add an option to show the matches from a selected book (shown in the example below.
  2. (1%) Add support fot a second author or set of works. The second file must be at least 1Mb, and you will need to format it appropriately. You will have two programs, one for Shakespeare, and onother for the new file.
>
>
  1. (0.5%) Highlight the matching words (bold or color)
  2. (1%) Add an option to show the matching paragraphs from a selected book (shown in the example below).
  3. (1%) Choose whether to see matching paragraph or just sentences.
  4. (1%) Add support for a second author or set of works. The second file must be at least 1Mb, and you will need to format it appropriately. You will have two programs, one for Shakespeare, and another for the new file.
 
  1. (2%) Add support for 5 or more authors, and start with a menu listing the options, and allowing the user to select the works, then to the other operations. This option is mutually exclusive with #2.
  2. (1%) Add support to #3 to search ALL books.
  3. (2%) Add support to #1 & #2 to search for pairs of words, not necessarily adjacent.
  4. (1%) Add support to #5 to search for words within some specified numbers of word apart.
Added:
>
>
  1. (2%) Add Stemming.
 
  1. More to come ...
Changed:
<
<
>
>

The Class Definitations

  %CODE{"c++"}% class paragraph {
Line: 68 to 71
  %ENDCODE%
Added:
>
>
The program should have a vector of book.

Run Example

Welcome to the Shakespeare search program
Books (# of paragraphs)
1.  THE SONNETS (311)
2.  ALLS WELL THAT ENDS WELL (233)
3.  THE TRAGEDY OF ANTONY AND CLEOPATRA (313)
4.  AS YOU LIKE IT (243)
5.  THE COMEDY OF ERRORS (149)
6.  THE TRAGEDY OF CORIOLANUS (331)
7.  CYMBELINE (290)
8.  THE TRAGEDY OF HAMLET, PRINCE OF DENMARK (313)
9.  THE FIRST PART OF KING HENRY THE FOURTH (237)
10.  SECOND PART OF KING HENRY IV (259)
11.  THE LIFE OF KING HENRY THE FIFTH (279)
12.  THE FIRST PART OF HENRY THE SIXTH (312)
13.  THE SECOND PART OF KING HENRY THE SIXTH (287)
14.  THE THIRD PART OF KING HENRY THE SIXTH (285)
15.  KING HENRY THE EIGHTH (233)
16.  KING JOHN (198)
17.  THE TRAGEDY OF JULIUS CAESAR (211)
18.  THE TRAGEDY OF KING LEAR (310)
19.  LOVE'S LABOUR'S LOST (144)
20.  THE TRAGEDY OF MACBETH (506)
21.  THE MERCHANT OF VENICE (203)
22.  THE MERRY WIVES OF WINDSOR (308)
23.  A MIDSUMMER NIGHT'S DREAM (172)
24.  MUCH ADO ABOUT NOTHING (197)
25.  THE TRAGEDY OF OTHELLO, MOOR OF VENICE (223)
26.  KING RICHARD THE SECOND (212)
27.  KING RICHARD III (344)
28.  THE TRAGEDY OF ROMEO AND JULIET (294)
29.  THE TAMING OF THE SHREW (213)
30.  THE TEMPEST (165)
31.  THE LIFE OF TIMON OF ATHENS (226)
32.  THE TRAGEDY OF TITUS ANDRONICUS (195)
33.  THE HISTORY OF TROILUS AND CRESSIDA (306)
34.  TWELFTH NIGHT; OR, WHAT YOU WILL (245)
35.  THE TWO GENTLEMEN OF VERONA (200)
36.  THE WINTER'S TALE (184)
37.  A LOVER'S COMPLAINT (50)
Number of Books: 37

Word to search for:sail
1.  THE SONNETS has 5 matches.
2.  ALLS WELL THAT ENDS WELL has 1 matches.
3.  THE TRAGEDY OF ANTONY AND CLEOPATRA has 7 matches.
4.  AS YOU LIKE IT has 1 matches.
5.  THE COMEDY OF ERRORS has 2 matches.
6.  THE TRAGEDY OF CORIOLANUS has 1 matches.
7.  CYMBELINE has 5 matches.
8.  THE TRAGEDY OF HAMLET, PRINCE OF DENMARK has 5 matches.
10.  SECOND PART OF KING HENRY IV has 2 matches.
11.  THE LIFE OF KING HENRY THE FIFTH has 3 matches.
12.  THE FIRST PART OF HENRY THE SIXTH has 2 matches.
13.  THE SECOND PART OF KING HENRY THE SIXTH has 3 matches.
14.  THE THIRD PART OF KING HENRY THE SIXTH has 6 matches.
16.  KING JOHN has 5 matches.
17.  THE TRAGEDY OF JULIUS CAESAR has 1 matches.
19.  LOVE'S LABOUR'S LOST has 2 matches.
20.  THE TRAGEDY OF MACBETH has 3 matches.
21.  THE MERCHANT OF VENICE has 6 matches.
22.  THE MERRY WIVES OF WINDSOR has 1 matches.
23.  A MIDSUMMER NIGHT'S DREAM has 2 matches.
24.  MUCH ADO ABOUT NOTHING has 1 matches.
25.  THE TRAGEDY OF OTHELLO, MOOR OF VENICE has 9 matches.
26.  KING RICHARD THE SECOND has 1 matches.
27.  KING RICHARD III has 3 matches.
28.  THE TRAGEDY OF ROMEO AND JULIET has 4 matches.
29.  THE TAMING OF THE SHREW has 1 matches.
30.  THE TEMPEST has 8 matches.
33.  THE HISTORY OF TROILUS AND CRESSIDA has 5 matches.
34.  TWELFTH NIGHT; OR, WHAT YOU WILL has 5 matches.
37.  A LOVER'S COMPLAINT has 1 matches.
Enter book number to view matches, 0 for a new search, -1 to end: 29

Matches of "sail" in book " THE TAMING OF THE SHREW"

  TRANIO. Sir, what are you that offer to beat my servant?  VINCENTIO. What am I, sir? Nay, what are you, sir? O immortal gods!
    O fine villain! A silken doublet, a velvet hose, a scarlet cloak,
    and a copatain hat! O, I am undone! I am undone! While I play the
    good husband at home, my son and my servant spend all at the
    university.
  TRANIO. How now! what's the matter?
  BAPTISTA. What, is the man lunatic?
  TRANIO. Sir, you seem a sober ancient gentleman by your habit, but
    your words show you a madman. Why, sir, what 'cerns it you if I
    wear pearl and gold? I thank my good father, I am able to
    maintain it.
  VINCENTIO. Thy father! O villain! he is a sailmaker in Bergamo.
  BAPTISTA. You mistake, sir; you mistake, sir. Pray, what do you
    think is his name?
  VINCENTIO. His name! As if I knew not his name! I have brought him
    up ever since he was three years old, and his name is Tranio.
  PEDANT. Away, away, mad ass! His name is Lucentio; and he is mine
    only son, and heir to the lands of me, Signior Vicentio.
  VINCENTIO. Lucentio! O, he hath murd'red his master! Lay hold on
    him, I charge you, in the Duke's name. O, my son, my son! Tell
    me, thou villain, where is my son, Lucentio?
  TRANIO. Call forth an officer.


Enter book number to view matches, 0 for a new search, -1 to end: 

 

META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1447783897" name="Shakespeare.txt" path="Shakespeare.txt" size="5465307" user="JimSkon" version="1"

Revision 12015-11-17 - JimSkon

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Lab 10

Due: Dec 10, 11:55pm

Instructions

  • Turn in the code (a cpp file or ideone.com link), and the run outputs as requested below.
  • Remember to format the code as described and the book and text, and to include comments including complete commetns at the beginning of the program.

Grading

Feature %
Program correctness and completeness with respect to defination 70%
Code Format (Indenting, variable names) 10%
Code Comments 10%
Turning in the run the requested inputs below.. 10%

Problem

Shakespeare Word Search

Your goal is to use Object Oriented techniques to read the complete works of Shakespeare from a file, and allow for word searches.

A complete version of all works of Shakespeare in a single file is preseanted here.

Your program must do at least the following:

  1. Read in the entire file of Shakespeare books, and parse it into Books and Paragraphs, where Books is object the contains an entire book (definition below), and Paragraph is an object representation of a paragraph (also below). Thus there will be an array of Books, and each book will be a title plus an array of paragraphs.
  2. Show the user a list of the book titles, alone with the number of paragraphs found in each.
  3. Ask the user for a word to search, and show the users how many paragraphs in each book has a match for this word.
  4. Repeat the above step until the user is done.

Extra credit

Since this is the lass project you will have the opportunity to explore this problem, and add extra credit toward your overall grade. Following are a list of possible options, with a percent of how much it add to your OVERALL grade. You may propose additional improvements for extra credit by emailing me with a proposal, and I will decide if it can be approved, and how much it is worth.

Some options:

  1. (1%) Add an option to show the matches from a selected book (shown in the example below.
  2. (1%) Add support fot a second author or set of works. The second file must be at least 1Mb, and you will need to format it appropriately. You will have two programs, one for Shakespeare, and onother for the new file.
  3. (2%) Add support for 5 or more authors, and start with a menu listing the options, and allowing the user to select the works, then to the other operations. This option is mutually exclusive with #2.
  4. (1%) Add support to #3 to search ALL books.
  5. (2%) Add support to #1 & #2 to search for pairs of words, not necessarily adjacent.
  6. (1%) Add support to #5 to search for words within some specified numbers of word apart.
  7. More to come ...

<-- SyntaxHighlightingPlugin -->
class paragraph {
    private:
        string text;
    public:
        paragraph();
        void setText(string p);
        bool search(string word);
        void display();
};

class book {
    private:
        string title;
        vector<paragraph> paragraphs;
    public:
        book();
        void setTitle(string title);
        string getTitle();
        int search(string word);
        void add(paragraph p);
        void clear();
        int getParaCount();
        void displayMatches(string search);
};

 
<-- end SyntaxHighlightingPlugin -->

META FILEATTACHMENT attachment="Shakespeare.txt" attr="" comment="" date="1447783897" name="Shakespeare.txt" path="Shakespeare.txt" size="5465307" user="JimSkon" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback