Index: tools/smaz.adb ================================================================== --- tools/smaz.adb +++ tools/smaz.adb @@ -82,11 +82,13 @@ Text_List_Input, Fast_Text_Input, Max_Word_Size, Sx_Output, No_Sx_Output, - Score_Method); + No_Vlen_Verbatim, + Score_Method, + Vlen_Verbatim); end Options; package Getopt is new Natools.Getopt_Long (Options.Id); type Callback is new Getopt.Handlers.Callback with record @@ -97,10 +99,11 @@ Sx_Dict_Output : Boolean := False; Min_Sub_Size : Positive := 1; Max_Sub_Size : Positive := 3; Max_Word_Size : Positive := 10; Dict_Size : Positive := 254; + Vlen_Verbatim : Boolean := True; 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; @@ -320,10 +323,16 @@ when Options.Max_Pending => Handler.Max_Pending := Ada.Containers.Count_Type'Value (Argument); when Options.Dict_Size => Handler.Dict_Size := Positive'Value (Argument); + + when Options.Vlen_Verbatim => + Handler.Vlen_Verbatim := True; + + when Options.No_Vlen_Verbatim => + Handler.Vlen_Verbatim := False; end case; end Option; procedure Evaluate_Dictionary @@ -386,11 +395,13 @@ 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); R.Add_Option ("s-expr", 'x', No_Argument, Sx_Output); R.Add_Option ("no-s-expr", 'X', No_Argument, No_Sx_Output); + R.Add_Option ("no-vlen-verbatim", No_Argument, No_Vlen_Verbatim); R.Add_Option ("score-method", Required_Argument, Score_Method); + R.Add_Option ("vlen-verbatim", No_Argument, Vlen_Verbatim); return R; end Getopt_Config; @@ -762,10 +773,20 @@ when Options.Dict_Size => Put_Line (Output, " "); Put_Line (Output, Indent & Indent & "Number of words in the dictionary to build"); + + when Options.Vlen_Verbatim => + New_Line (Output); + Put_Line (Output, Indent & Indent + & "Enable variable-length verbatim in built dictionary"); + + when Options.No_Vlen_Verbatim => + New_Line (Output); + Put_Line (Output, Indent & Indent + & "Disable variable-length verbatim in built dictionary"); end case; end loop; end Print_Help; @@ -820,11 +841,11 @@ Handler.Score_Method); end; else return Natools.Smaz.Tools.To_Dictionary (Natools.Smaz.Tools.Simple_Dictionary (Counter, 254), - True); + Handler.Vlen_Verbatim); end if; end; end case; end To_Dictionary;