Natools

Check-in [3b85da8290]
Login

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

Overview
Comment:tools/smaz: move Adjust_Dictionary call into To_Dictionary function
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3b85da82905a5501054b217d9c077e558c1b1c02
User & Date: nat 2017-05-12 22:26:04
Context
2017-05-13
20:47
tools/smaz: refactor word count construction check-in: b2dbec1810 user: nat tags: trunk
2017-05-12
22:26
tools/smaz: move Adjust_Dictionary call into To_Dictionary function check-in: 3b85da8290 user: nat tags: trunk
2017-05-10
20:59
tools/smaz: add a new action for dedicated dictionary modification check-in: 9ab0cc7cbf user: nat tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/smaz.adb.

401
402
403
404
405
406
407

408
409
410
411
412
413
414
         Data_List : in String_Lists.List;
         Method : in Methods);
         --  Perform the requested operations

      function To_Dictionary
        (Handler : in Callback'Class;
         Input : in String_Lists.List;

         Method : in Methods)
        return Dictionary;
         --  Convert the input into a dictionary given the option in Handler

   end Dictionary_Subprograms;









>







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
         Data_List : in String_Lists.List;
         Method : in Methods);
         --  Perform the requested operations

      function To_Dictionary
        (Handler : in Callback'Class;
         Input : in String_Lists.List;
         Data_List : in String_Lists.List;
         Method : in Methods)
        return Dictionary;
         --  Convert the input into a dictionary given the option in Handler

   end Dictionary_Subprograms;


727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
      procedure Process
        (Handler : in Callback'Class;
         Word_List : in String_Lists.List;
         Data_List : in String_Lists.List;
         Method : in Methods)
      is
         Dict : constant Dictionary := Activate_Dictionary
           (Adjust_Dictionary
              (Handler,
               To_Dictionary (Handler, Word_List, Method),
               Data_List,
               Method));
         Sx_Output : Natools.S_Expressions.Printers.Canonical
           (Ada.Text_IO.Text_Streams.Stream (Ada.Text_IO.Current_Output));
         Ada_Dictionary : constant String
           := Ada.Strings.Unbounded.To_String (Handler.Ada_Dictionary);
         Hash_Package : constant String
           := Ada.Strings.Unbounded.To_String (Handler.Hash_Package);
      begin







<
<
|
<
<







728
729
730
731
732
733
734


735


736
737
738
739
740
741
742
      procedure Process
        (Handler : in Callback'Class;
         Word_List : in String_Lists.List;
         Data_List : in String_Lists.List;
         Method : in Methods)
      is
         Dict : constant Dictionary := Activate_Dictionary


           (To_Dictionary (Handler, Word_List, Data_List, Method));


         Sx_Output : Natools.S_Expressions.Printers.Canonical
           (Ada.Text_IO.Text_Streams.Stream (Ada.Text_IO.Current_Output));
         Ada_Dictionary : constant String
           := Ada.Strings.Unbounded.To_String (Handler.Ada_Dictionary);
         Hash_Package : constant String
           := Ada.Strings.Unbounded.To_String (Handler.Hash_Package);
      begin
1039
1040
1041
1042
1043
1044
1045

1046
1047
1048
1049
1050
1051
1052
1053


1054


1055
1056
1057
1058
1059
1060
1061
         end case;
      end Process;


      function To_Dictionary
        (Handler : in Callback'Class;
         Input : in String_Lists.List;

         Method : in Methods)
        return Dictionary
      is
         use type Natools.Smaz_Tools.String_Count;
         use type Dict_Sources.Enum;
      begin
         case Handler.Dict_Source is
            when Dict_Sources.S_Expression =>


               return To_Dictionary (Input, Handler.Vlen_Verbatim);



            when Dict_Sources.Text_List | Dict_Sources.Unoptimized_Text_List =>
               declare
                  Counter : Word_Counter;
               begin
                  for S of Input loop
                     Add_Substrings







>








>
>
|
>
>







1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
         end case;
      end Process;


      function To_Dictionary
        (Handler : in Callback'Class;
         Input : in String_Lists.List;
         Data_List : in String_Lists.List;
         Method : in Methods)
        return Dictionary
      is
         use type Natools.Smaz_Tools.String_Count;
         use type Dict_Sources.Enum;
      begin
         case Handler.Dict_Source is
            when Dict_Sources.S_Expression =>
               return Adjust_Dictionary
                 (Handler,
                  To_Dictionary (Input, Handler.Vlen_Verbatim),
                  Data_List,
                  Method);

            when Dict_Sources.Text_List | Dict_Sources.Unoptimized_Text_List =>
               declare
                  Counter : Word_Counter;
               begin
                  for S of Input loop
                     Add_Substrings