KeyNoteWeightedMatching.mesa
Copyright Ó 1985, 1986 by Xerox Corporation. All rights reserved.
Jack Kent January 21, 1988 7:31:23 pm PST
The Weighted Matching algorithm is passed down a list of keywords. It returns a list of FileItems. Each FileItem contains a fileName and a list of keyword items. A keyword item is a keyWordName and a frequency.
The algorithm for the Weighted Matching algorithm goes as follows:
(1) For each keyword ki, get a list of all fileName containing ki, call this L[ki].
(2) For each L[ki], traverse list, and add results of entry to CumulativeHashTable.
(3) Dump results of CumulativeHashTable back to FinalList. Sort final List by frequency. Done.
DIRECTORY
KeyNote,
Rope;
KeyNoteWeightedMatching: CEDAR DEFINITIONS = BEGIN
Types
rcompile
ROPE: TYPE = Rope.ROPE;
TokenInfoList: TYPE = LIST OF TokenInfo;
TokenInfo: TYPE = REF ANY;
TokenInfo: TYPE = REF TokenInfoObject;
TokenInfoObject: TYPE = RECORD [
token: ROPE,
frequency: INTEGER];
Procedures
WeightedMatch: PROC [db: KeyNote.Handle, ropeList: KeyNote.ResultList] RETURNS [resultList: KeyNote.ResultList];
END.