Histogram
: Map; -- String key, Integer
element
...
procedure
Add (Word : in String) is
procedure Increment_Count
(Key : in String; Count : in out Integer)
is
begin
Count := Count + 1;
end;
C : constant Cursor := Histogram.Find
(Word);
begin
if Has_Element (C) then -- found
Update_Element (C,
Increment_Count’Process);
else
Histogram.Insert (Word, 1);
end if;
end Add;