主权项 |
1. A method comprising:
receiving, by a computing device, an inquiry word; segmenting, by the computing device, the inquiry word into one or more keywords; searching, by the computing device, an inverted index of a group of documents to determine in the group one or more documents in which one or more of the keywords are matched; and searching, by the computing device, a forward index of a respective document of the determined one or more documents to generate an abstract for the respective document, the searching including:
determining a length limit of the abstract;identifying a plurality of portions within the respective document, each portion of the plurality of portions including a respective beginning position in the respective document and a respective ending position in the respective document, the identifying including identifying, within the respective document, every portion that is within the length limit by traversing the forward index character-by-character or word-by-word;finding a portion among the plurality of portions, the portion including a highest number of the one or more keywords between a beginning position and an ending position compared with any other portion of the plurality of portions; andselecting the found portion to be the abstract of the respective document. |