Problem

Write a program to reconstruct a text from a concordance of words. This was a real problem...

Write a program to reconstruct a text from a concordance of words. This was a real problem of reconstructing some unpublished texts of the Dead Sea Scrolls using concordances. For example, here is William Wordsworth's poem, Nature and the Poet, and a concordance of words corresponding with the poem. So pure the sky, so quiet was the air!

So like, so very like, was day to day!

Whene'er I look'd, thy image still was there;

It trembled, but it never pass'd away.

The 33-word concordance is as follows:

1:1 so quiet was the *air!1:4 but it never pass'd *away.1:4 It trembled, *but it never1:2 was *day to day!1:2 was day to *day!1:3 thy *image still was there;. . . . . . . . . . . . . . . . 1:2 so very like, *was day1:3 thy image still *was there;1:3 *Whene'er I look'd,

In this concordance, each word is shown in a context of up to five words, and the word referred to on each line is preceded with a star. For larger concordances, two numbers have to be included, a number corresponding with a poem and a number of the line where the words can be found. For example, assuming that 1 is the number of Nature and the Poet, line “1:4 but it never pass'd *away.” means that the word “away” is found in this poem in line 4. Note that punctuation marks are included in the context.

Write a program that loads a concordance from a file and creates a vector where each cell is associated with one line of the concordance. Then, using a binary search, reconstruct the text.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 1
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT