68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
=> Dictionary.Offsets (I) in Dictionary.Values'Range
and then ((if I = Dictionary.Offsets'Last
then Dictionary.Values'Last + 1
else Dictionary.Offsets (I + 1))
- Dictionary.Offsets (I)
in 1 .. Dictionary.Max_Word_Length));
function Compressed_Upper_Bound
(Dict : in Dictionary;
Input : in String)
return Ada.Streams.Stream_Element_Count;
-- Return the maximum number of bytes needed to encode Input
|
>
>
>
>
>
>
>
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
=> Dictionary.Offsets (I) in Dictionary.Values'Range
and then ((if I = Dictionary.Offsets'Last
then Dictionary.Values'Last + 1
else Dictionary.Offsets (I + 1))
- Dictionary.Offsets (I)
in 1 .. Dictionary.Max_Word_Length));
function Dict_Entry
(Dict : in Dictionary;
Index : in Ada.Streams.Stream_Element)
return String
with Pre => Index <= Dict.Dict_Last;
-- Return the string for at the given Index in Dict
function Compressed_Upper_Bound
(Dict : in Dictionary;
Input : in String)
return Ada.Streams.Stream_Element_Count;
-- Return the maximum number of bytes needed to encode Input
|