Natools

Diff
Login

Diff

Differences From Artifact [6d6d345c58]:

To Artifact [ec9ad0d224]:


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
      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;







|
>




|




|
<
<







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
      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;