513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
|
end loop;
end Evaluate_Dictionary_Partial;
function Worst_Index
(Dict : in Dictionary;
Counts : in Dictionary_Counts;
Method : in Smaz_Tools.Methods.Enum)
return Dictionary_Code
is
use type Smaz_Tools.Score_Value;
Result : Dictionary_Code := Dictionary_Code'First;
Worst_Score : Smaz_Tools.Score_Value
:= Score (Dict, Counts, Result, Method);
S : Smaz_Tools.Score_Value;
begin
for I in Dictionary_Code'Succ (Dictionary_Code'First)
.. Dict.Last_Code
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_Generic.Tools;
|
|
>
|
|
<
<
|
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
|
end loop;
end Evaluate_Dictionary_Partial;
function Worst_Index
(Dict : in Dictionary;
Counts : in Dictionary_Counts;
Method : in Smaz_Tools.Methods.Enum;
First, Last : in Dictionary_Code)
return Dictionary_Code
is
use type Smaz_Tools.Score_Value;
Result : Dictionary_Code := First;
Worst_Score : Smaz_Tools.Score_Value
:= Score (Dict, Counts, Result, Method);
S : Smaz_Tools.Score_Value;
begin
for I in Dictionary_Code'Succ (First) .. 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_Generic.Tools;
|