Natools

Diff
Login

Differences From Artifact [d93257e757]:

To Artifact [af4ec8d531]:


90
91
92
93
94
95
96













97
98
99
100
101
102
103
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116







+
+
+
+
+
+
+
+
+
+
+
+
+







                  => Dict_Entry (Dict, I)
                     = Dict_Entry (Append_String'Result, I))
               and then Dict_Entry (Append_String'Result,
                                    Append_String'Result.Last_Code)
                        = Value;
      --  Return a new dictionary with Value appended

   function Replace_Element
     (Dict : in Dictionary;
      Index : in Dictionary_Code;
      Value : in String)
     return Dictionary
     with Pre => Index <= Dict.Last_Code and then Value'Length > 0,
         Post => Dict.Last_Code = Replace_Element'Result.Last_Code
               and then (for all I in Dictionary_Code'First .. Dict.Last_Code
                  => (I = Index or else Dict_Entry (Dict, I)
                                    = Dict_Entry (Replace_Element'Result, I)))
               and then Dict_Entry (Replace_Element'Result, Index) = Value;
      --  Return a new dictionary with entry at Index replaced by Value


   type Dictionary_Counts is
     array (Dictionary_Code) of Smaz_Tools.String_Count;

   procedure Evaluate_Dictionary
     (Dict : in Dictionary;
      Corpus : in String_Lists.List;