836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
|
-
-
-
-
-
-
-
-
+
|
function To_Scored_Word
(Cursor : in Word_Maps.Cursor;
Method : in Methods.Enum)
return Scored_Word
is
Word : constant String := Word_Maps.Key (Cursor);
Factor : Score_Value;
begin
case Method is
when Methods.Encoded => Factor := Word'Length;
when Methods.Frequency => Factor := 1;
when Methods.Gain => Factor := Word'Length - 1;
end case;
return Scored_Word'
(Size => Word'Length,
Word => Word,
Score => Score_Value (Word_Maps.Element (Cursor)) * Factor);
Score => Score (Word_Maps.Element (Cursor), Word'Length, Method));
end To_Scored_Word;
function Worst_Index
(Dict : in Dictionary;
Counts : in Dictionary_Counts;
Method : in Methods.Enum)
|