Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | tools/smaz: add a new action for dedicated dictionary modification |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
9ab0cc7cbfdbf767979dabc1507d7ea4 |
| User & Date: | nat 2017-05-10 20:59:08.189 |
Context
|
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 | |
|
2017-05-09
| ||
| 20:45 | tools/smaz: implement the new forced words feature check-in: e252a053ef user: nat tags: trunk | |
Changes
Changes to tools/smaz.adb.
| ︙ | ︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
package Tools_64 is new Natools.Smaz_64.Tools;
package Methods renames Natools.Smaz_Tools.Methods;
package Actions is
type Enum is
(Nothing,
Decode,
Encode,
Evaluate);
end Actions;
package Algorithms is
type Enum is
| > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
package Tools_64 is new Natools.Smaz_64.Tools;
package Methods renames Natools.Smaz_Tools.Methods;
package Actions is
type Enum is
(Nothing,
Adjust_Dictionary,
Decode,
Encode,
Evaluate);
end Actions;
package Algorithms is
type Enum is
|
| ︙ | ︙ | |||
755 756 757 758 759 760 761 |
for I in Dictionary_Entry'First .. Last_Code (Dict) loop
Sx_Output.Append_String (Dict_Entry (Dict, I));
end loop;
Sx_Output.Close_List;
end if;
case Handler.Action is
| | | 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 |
for I in Dictionary_Entry'First .. Last_Code (Dict) loop
Sx_Output.Append_String (Dict_Entry (Dict, I));
end loop;
Sx_Output.Close_List;
end if;
case Handler.Action is
when Actions.Nothing | Actions.Adjust_Dictionary => null;
when Actions.Decode =>
if Handler.Sx_Output then
Sx_Output.Open_List;
for S of Data_List loop
Sx_Output.Append_String (Decompress (Dict, To_SEA (S)));
end loop;
|
| ︙ | ︙ | |||
1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 |
when Options.Check_Roundtrip =>
Handler.Check_Roundtrip := True;
when Options.Force_Word =>
if Argument'Length > 0 then
Handler.Need_Dictionary := True;
Handler.Forced_Words.Append (Argument);
end if;
end case;
end Option;
function Activate_Dictionary (Dict : in Natools.Smaz_256.Dictionary)
return Natools.Smaz_256.Dictionary
| > > > > | 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 |
when Options.Check_Roundtrip =>
Handler.Check_Roundtrip := True;
when Options.Force_Word =>
if Argument'Length > 0 then
Handler.Need_Dictionary := True;
Handler.Forced_Words.Append (Argument);
if Handler.Action in Actions.Nothing then
Handler.Action := Actions.Adjust_Dictionary;
end if;
end if;
end case;
end Option;
function Activate_Dictionary (Dict : in Natools.Smaz_256.Dictionary)
return Natools.Smaz_256.Dictionary
|
| ︙ | ︙ |