In this video, you put players’ questions to search() and printed the rank, score, game, page and heading of every chunk that came back. Two questions found the page that answers them. A third, which names a card number, didn’t, and reading the chunks’ text showed where its card ranked.
Key Points
- See what the search found. Later in the course, the rules desk answers from the chunks
search()returns, so a page that isn’t among them can’t be used. A printout shows which chunks came back, from which game and page, and with what score. - One line per result.
printResults()prints the question, then, for each result, its rank (starting at 1), its score to three decimal places, and its game, page and heading, orno headingif there isn’t one. - Two questions, two right pages. Table 6’s Lantern Harbor question puts page 4, Trading, on top at 0.663. That’s the page with the pier rule, and the seating rule’s chunk comes second. Question 3’s Copper Canyon Express tie puts page 7, Breaking a Tie, on top at 0.719, the last page that a whole-book vector never reached. All six results come from the game each question names.
- A miss. A new question from table 5 asks whether card 17 changes how many shells the market wants in Tidepool Traders. Its top three are page 4, Trading, page 1, Components, and page 5, Scoring. Page 4 has the market’s rate, so it belongs there, but card 17 is on page 3, under Tide Cards, and that page isn’t in the list. Given only these chunks, a model may make up a rule for card 17, as it did in the first lesson.
- A score can’t confirm a page. The miss’s top score, 0.641, is close to the 0.663 that found the pier rule. A score ranks chunks for one question. It can’t tell you whether the right page came back.
- Raise k, then read the text. With
kat 6, page 3 shows up twice, because its Tide Cards section is two chunks. A loop prints the rank, id and text of each page 3 result. The one in sixth place, at 0.580,tidepool-traders-6, has card 17’s rule in full, and the fifth,tidepool-traders-7, has only its last words. A biggerkhelps you look for a missing chunk, but it isn’t the fix. It sends more text with each question, and the search still ranks card 17’s chunk below five others, even the components list.
The rule:
- Print rank, score, game and page, and check them against the chunk that answers the question.
- Missing? Raise
kto see where it ranked, and read its text.