<think>
Okay, let's see. The user says that the build_word_index function is indexing a note incorrectly. The problem is that a word appearing multiple times on the same line is being assigned the line number once per appearance. But according to the task, each occurrence of the word on a line should add the line number once, but the current code is appending the row number each time the word is found. Wait, no, the current code is appending the row number for each occurrence. But the problem says that the line number should be added once per appearance. Wait, the task says that the index must map each word to the strictly increasing list of line numbers where the word appears. So if a word appears multiple times on the same line, the line number should be added once per occurrence? Or once per line?

Wait, the problem says: "a word appearing several times on one line records that line number once per appearance." So if a word appears three times on the same line, the line number is added three times. But the task says that the index should have the line numbers in strictly increasing order, each number listed once however often the word recurs on its line. Wait, the original code is appending the row number each time the word is found. So if a word is found multiple times on the same line, the same row number is added multiple times. But the problem says that the line number should be added once per occurrence. Wait, the user says that the current code is incorrect. The companion function words_of_line is correct, so the problem is in build_word_index.

Wait, the task says that the index must map every word to the strictly increasing list of line numbers holding that word, each number listed once however often the word recurs on its line. So, for example, if a word appears three times on line 5, then the line number 5 should be added once. But the current code is adding it three times. So the problem is that the current code is appending the row number for each occurrence of the word, but the correct approach is to add the row number once per line, regardless of how many times the word appears on that line.

So the error is that the current code is adding the row number for each occurrence of the word on the same line, but it should add the row number once per line, even if the word appears multiple times on that line.

So the fix is: for each line, when processing the words, collect the line number once per line, even if the same word appears multiple times on that line. So, for each line, we need to collect the line number once, and add it to the list of line numbers for each word in that line.

Wait, but the words_of_line function returns all the words in the line. So if a line has multiple instances of the same word, words_of_line would return that word multiple times. So the current code is adding the line number for each occurrence. But the problem says that the line number should be added once per occurrence. Wait, no, the problem says that the line number should be added once per occurrence. Wait, the task says: "the index must map every word to the strictly increasing list of the line numbers holding that word, each number listed once however often the word recurs on its line." So if the word recurs on the same line multiple times, the line number is added once per occurrence. Wait, that's not possible. Wait, the wording is confusing. Let me re-read the problem.

The problem says: "a word appearing several times on one line records that line number once per appearance." So if a word appears three times on the same line, the line number is added three times. But the current code is doing that.