915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
|
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
|
-
+
+
-
-
+
+
-
+
|
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)
Method : in Methods.Enum;
First, Last : in Ada.Streams.Stream_Element)
return Ada.Streams.Stream_Element
is
Result : Ada.Streams.Stream_Element := 0;
Worst_Score : Score_Value := Score (Dict, Counts, 0, Method);
Result : Ada.Streams.Stream_Element := First;
Worst_Score : Score_Value := Score (Dict, Counts, First, Method);
S : Score_Value;
begin
for I in 1 .. Dict.Dict_Last loop
for I in First + 1 .. Last loop
S := Score (Dict, Counts, I, Method);
if S < Worst_Score then
Result := I;
Worst_Score := S;
end if;
end loop;
return Result;
end Worst_Index;
end Natools.Smaz.Tools;
|