with Ada.Containers.Indefinite_Hashed_Sets;  use Ada.Containers;
pragma Elaborate_All (Ada.Containers.Indefinite_Hashed_Sets);

package Wordfreq_Types is
   pragma Preelaborate;

   type Data_Type (Word_Length : Positive) is record
      Word  : String (1 .. Word_Length);
      Count : Natural;
   end record;

   function Hash (Data : Data_Type) return Hash_Type;
   function Equivalent (L, R : Data_Type) return Boolean;

   package Data_Sets is new Ada.Containers.Indefinite_Hashed_Sets
     (Data_Type,
      Hash,
      Equivalent);

   procedure Insert (Data_Set : in out Data_Sets.Set; Word : in String);

   type Cursor_Array is array (Count_Type range <>) of Data_Sets.Cursor;

   procedure Sort (Cursors : in out Cursor_Array);

end Wordfreq_Types;
