Index: tools/smaz.adb ================================================================== --- tools/smaz.adb +++ tools/smaz.adb @@ -73,10 +73,11 @@ Job_Count, Help, Sx_Dict_Output, Min_Sub_Size, Max_Sub_Size, + Max_Pending, Stat_Output, No_Stat_Output, Text_List_Input, Fast_Text_Input, Max_Word_Size, @@ -94,10 +95,12 @@ Sx_Output : Boolean := False; Sx_Dict_Output : Boolean := False; Min_Sub_Size : Positive := 1; Max_Sub_Size : Positive := 3; Max_Word_Size : Positive := 10; + Max_Pending : Ada.Containers.Count_Type + := Ada.Containers.Count_Type'Last; Job_Count : Natural := 0; Filter_Threshold : Natools.Smaz.Tools.String_Count := 0; Score_Method : Methods.Enum := Methods.Encoded; Action : Actions.Enum := Actions.Nothing; Ada_Dictionary : Ada.Strings.Unbounded.Unbounded_String; @@ -309,10 +312,13 @@ Handler.Filter_Threshold := Natools.Smaz.Tools.String_Count'Value (Argument); when Options.Score_Method => Handler.Score_Method := Methods.Enum'Value (Argument); + + when Options.Max_Pending => + Handler.Max_Pending := Ada.Containers.Count_Type'Value (Argument); end case; end Option; procedure Evaluate_Dictionary @@ -366,10 +372,11 @@ R.Add_Option ("hash-pkg", 'H', Required_Argument, Output_Hash); R.Add_Option ("jobs", 'j', Required_Argument, Job_Count); R.Add_Option ("sx-dict", 'L', No_Argument, Sx_Dict_Output); R.Add_Option ("min-substring", 'm', Required_Argument, Min_Sub_Size); R.Add_Option ("max-substring", 'M', Required_Argument, Max_Sub_Size); + R.Add_Option ("max-pending", 'M', Required_Argument, Max_Pending); R.Add_Option ("stats", 's', No_Argument, Stat_Output); R.Add_Option ("no-stats", 'S', No_Argument, No_Stat_Output); R.Add_Option ("text-list", 't', No_Argument, Text_List_Input); R.Add_Option ("fast-text-list", 'T', No_Argument, Fast_Text_Input); R.Add_Option ("max-word-len", 'W', Required_Argument, Max_Word_Size); @@ -738,10 +745,16 @@ when Options.Score_Method => Put_Line (Output, " "); Put_Line (Output, Indent & Indent & "Select heuristic method to replace dictionary items" & " during optimization"); + + when Options.Max_Pending => + Put_Line (Output, " "); + Put_Line (Output, Indent & Indent + & "Maximum size of candidate list" + & " when building a dictionary"); end case; end loop; end Print_Help; @@ -780,11 +793,11 @@ if Handler.Dict_Source = Dict_Sources.Text_List then declare Selected, Pending : Natools.Smaz.Tools.String_Lists.List; begin Natools.Smaz.Tools.Simple_Dictionary_And_Pending - (Counter, 254, Selected, Pending); + (Counter, 254, Selected, Pending, Handler.Max_Pending); return Optimize_Dictionary (Natools.Smaz.Tools.To_Dictionary (Selected, True), Pending, Input,