DIRECTORY Rope, RedBlackTree; KeyNoteTokenFreqPerFileTable: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Table: TYPE = RedBlackTree.Table; Compare: TYPE = RedBlackTree.Compare; EachNode: TYPE = RedBlackTree.EachNode; Node: TYPE = RedBlackTree.Node; Key: TYPE = RedBlackTree.Key; UserData: TYPE = REF UserDataObject; UserDataObject: TYPE = RECORD [ token: ROPE, frequency: INTEGER]; Create: PROC [] RETURNS [table: Table]; DestroyTable: PROC [table: Table]; InsertAndBumpFrequncy: PROC [table: Table, tokenName: ROPE]; EnumerateDecreasing: PROC [table: Table, procToApply: EachNode]; LookupNextLarger: PROC [self: Table, tokenName: ROPE] RETURNS [data: UserData]; Lookup: PROC [ self: Table, tokenName: ROPE] RETURNS [data: UserData]; END. ΰKeyNoteTokenFreqPerFileTable.mesa Copyright Σ 1985, 1986 by Xerox Corporation. All rights reserved. Jack Kent January 14, 1988 11:37:45 am PST The TokenFreqPerFileTable is a structure used to 'hold' the (token, frequency) results while a given file is being perused. The results for a given file are then written out (in their entirety) to the database on behalf of a single transaction. Note: A RedBlack Tree was used instead of a Symbol Table as the latter provides no client controlled enumeration (only call-back procedures). Types Procedures This procedure creates a redBlack tree for KeyNote makes it empty. called between files inserts the entry tokenName into RedBlackTree and bumps frequency as a side-effect Κ·˜codešœ!™!KšœB™BKšœ*™*K™—Kšœτ™τK™šΟnœ‰™K™šΟk ˜ K˜šœ ˜ K˜———Kšœžœž œž˜7K˜™Kšžœžœžœ˜Kšœžœ˜!Kšœ žœ˜%Kšœ žœ˜'Kšœžœ˜Kšœžœ˜Kšœ žœžœ˜%šœžœžœ˜Jšœžœ˜ Jšœ žœ˜—J˜K˜—šœ ™ K™šœžœžœ˜'Kšœ2™2K™—š œžœ˜"Kšœ$™$K˜—šœžœžœ˜