Store ( Source => Filename, Item => S ) end Enter_Word procedure Store_Words is new Parse_Lines. Iterate ( Print_Source ) begin Print ( Sources ) if not Any_Output then Put ( "I did not find this in any of the given files!" ) end if New_Line ( 2 ) end Output procedure Read_From_File ( Table : in out Storage_Type Filename : String ) is F : File_Type procedure Enter_Word ( S : String ) is begin Table. Vector ) is Any_Output : Boolean := False procedure Print_Source ( S : String ) is begin if not Any_Output then - this is the first source found Put ( "Found in the following files: " ) Any_Output := True else - there has been at least one source before Put ( ", " ) end if Put ( S ) end Print_Source procedure Print is new Inv_Idx. ![]() ![]() ![]() Hash, Parse_Lines use Ada.Text_IO procedure Inverted_Index is type Process_Word is access procedure ( Word : String ) package Inv_Idx is new Generic_Inverted_Index ( Source_Type => String, Item_Type => String, Hash => ) use Inv_Idx procedure Output ( Sources : Source_Vecs. With Ada.Text_IO, Generic _ Inverted_Index, Ada.
0 Comments
Leave a Reply. |