DIRECTORY Rope, KeyNoteDatabase; KeyNote: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; FileName: TYPE = Rope.ROPE; FileNameList: TYPE = LIST OF Rope.ROPE; FileNamesToMatch: TYPE = REF FileNamesToMatchObject; FileNamesToMatchObject: TYPE = RECORD [ pattern: ROPE, wDir: ROPE _ NIL ]; WordVerifierProc: TYPE = PROCEDURE [clientData: REF ANY, word: ROPE] RETURNS [BOOLEAN]; TokenRelevanceThreshhold: TYPE = INT; StopListCutOff: TYPE = INT; Handle: TYPE = KeyNoteDatabase.DatabaseHandle; ResultList: TYPE = LIST OF Result; Result: TYPE = REF ANY; ResultObject: TYPE = RECORD [ fileName: ROPE, overAllWeight: REAL, tokenInfoList: TokenInfoList]; TokenInfoList: TYPE = LIST OF TokenInfo; TokenInfo: TYPE = REF ANY; TokenInfoObject: TYPE = RECORD [ token: ROPE, weight: REAL, frequency: INTEGER]; BuildStopList: PROCEDURE[fileNamesToMatch: FileNamesToMatch, stopListCutOff: StopListCutOff] RETURNS [wordList: ResultList]; OpenDatabase: PROCEDURE[databaseName: ROPE, fileNamesToMatch: FileNamesToMatch _ NIL, wordVerifierProc: WordVerifierProc _ NIL, tokenRelevanceThreshhold: TokenRelevanceThreshhold _ 1, clientDataForVerifierProc: REF ANY _ NIL] RETURNS [ db: Handle]; CloseDatabase: PROCEDURE [db: Handle]; AddDocumentToIndex: PROCEDURE [db: Handle, fileName: FileName, wordVerifierProc: WordVerifierProc] ; RemoveDocumentFromIndex: PROCEDURE [db: Handle, fileName: FileName, wordVerifierProc: WordVerifierProc]; FindDocumentsFromWords: PROCEDURE [db: Handle, ropeList: ResultList] RETURNS [resultList: ResultList]; Error: ERROR [ec: ErrorCode, explanation: ROPE _ NIL]; ErrorCode: TYPE = ATOM; END. âFile: KeyNote.mesa Copyright c 1987 by Xerox Corporation. All rights reserved. Contents: Last edited by: Jack Kent, January 29, 1988 1:50:15 pm PST for every fileName that matches the pattern, every word in fileName is called with WordVerifierProc to verify whether it is a word or it should be ignored. this identfies the MINIMUM number of times a token must appear within a document in order to be considered a bona-fide keyword...and thus relevant! the top "StopListCutOff" words that appear in the document universe WILL appear in the stopList. This stopList can then be passed down to the WordVerifierProc as clientData. ResultList is a List.LORA for easy sorting on overAllWeight Result: TYPE = REF ResultObject; Result: TYPE = ROPE; TokenInfoList is a List.LORA for easy sorting on weight contributed by tokens TokenInfo: TYPE = REF TokenInfoObject; used either to open or to build a database: if fileNamesToMatch=NIL THEN just open is presumed document entries returned are sorted by weight Errors raised during the execution of an operation indicate uncommon or abnormal conditions. Clients should be prepared to catch these. $DatabaseProblems -- look at KeyNoteDatabase.Error Jack Kent, December 21, 1987 2:20:15 pm PST Ê>˜šÏnœ™Jšœ Ïmœ1™<—Jšœ ™ šœ™Icodešœ+™+J˜—šÏk œ˜!J˜—JšœŸœŸ ˜J˜JšœŸœ˜J˜JšŸœŸœŸœ˜J˜Jšœ ŸœŸœ˜Jš œŸœŸœŸœŸœ˜'J™Jšœ›™›JšœŸœŸœ˜5Jš œŸœŸœ ŸœŸœŸœ˜JJšœŸœŸ œŸœŸœŸœŸœŸœ˜WJ˜J˜JšœŸœy™“JšœŸœŸœ˜%J˜JšœDŸœf™®JšœŸœŸœ˜J˜JšœŸœ"˜.J˜JšœŸœ"™;Jšœ ŸœŸœŸœ˜"JšœŸœŸœŸœ˜KšœŸœŸœ™!KšœŸœŸœ™šœŸœŸœ˜Jšœ Ÿœ˜JšœŸœ˜J˜J˜—JšœŸœ2™NJšœŸœŸœŸœ ˜(Jšœ ŸœŸœŸœ˜Jšœ ŸœŸœ™&šœŸœŸœ˜!JšœŸœ˜ JšœŸœ˜ Jšœ Ÿœ˜—J˜Jš œŸ œEŸœ˜|J™Jšœ@ŸœŸœ™^Jš œŸ œŸœ'Ÿœ(ŸœUŸœŸœŸœŸœ˜ùJ˜Jš œŸ œ˜&J˜JšœŸ œG˜dJ˜JšœŸ œF˜hJ˜J™.JšœŸ œ%Ÿœ˜gJ˜J™J™ˆKšœŸœŸœŸœ˜6šœ ŸœŸœ˜Kšœ2™2K™K™—J˜J˜JšŸœ˜Kšœ ÏrÐkr™+J˜—…—^~