Natools

Check-in [18a2c1690b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:smaz-tools: fix computation of the first score in Worst_Index
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 18a2c1690b872c0086430a397f3a9d7f79869f6f
User & Date: nat 2016-11-20 20:20:27
Context
2016-11-21
20:40
tools/smaz: fix direct dictionaries ignoring variable-length config check-in: b141a142f0 user: nat tags: trunk
2016-11-20
20:20
smaz-tools: fix computation of the first score in Worst_Index check-in: 18a2c1690b user: nat tags: trunk
2016-11-19
21:35
smaz-tools: refactor scoring in To_Scored_Word check-in: 25e91595e4 user: nat tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/natools-smaz-tools.adb.

851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
   function Worst_Index
     (Dict : in Dictionary;
      Counts : in Dictionary_Counts;
      Method : in Methods.Enum)
     return Ada.Streams.Stream_Element
   is
      Result : Ada.Streams.Stream_Element := 0;
      Worst_Score : Score_Value := Score_Encoded (Dict, Counts, 0);
      S : Score_Value;
   begin
      for I in 1 .. Dict.Dict_Last loop
         S := Score (Dict, Counts, I, Method);

         if S < Worst_Score then
            Result := I;







|







851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
   function Worst_Index
     (Dict : in Dictionary;
      Counts : in Dictionary_Counts;
      Method : in Methods.Enum)
     return Ada.Streams.Stream_Element
   is
      Result : Ada.Streams.Stream_Element := 0;
      Worst_Score : Score_Value := Score (Dict, Counts, 0, Method);
      S : Score_Value;
   begin
      for I in 1 .. Dict.Dict_Last loop
         S := Score (Dict, Counts, I, Method);

         if S < Worst_Score then
            Result := I;