Example 1

Suppose the dictionary looks like the following:
Hexadecimal Entry
Description
C1
Alphabet entry for character A; 2 child characters B and C. The first child index is X'100'.
100
Entry for character B; no additional extension characters; no children.
101
Entry for character C; additional extension character 1; 2 child characters D and E. The first child index is X'200'.
200
Entry for character D; 2 additional extension characters 1 and 2; no children.
201
Entry for character E; 4 additional extension characters 1, 2, 3, and 4; no children.
ieaa6cde

If the input string is AD, the output string will consist of 2 compression symbols: one for A and one for D. When examining the dictionary entry for character A, the system determines that none of A's children match the next input character, D, and so returns the compression symbol for A. When examining the dictionary entry for character D, the system determines that it has no children, and so returns the compression symbol for D.

If the input string is AB, the output string will consist of 1 compression symbol for both input characters. When examining the dictionary input for character A, the system determines that A's first child character matches the next input character, B, and so looks at entry X'100'. Because that entry has no additional extension characters, a match is determined. Because there are no further input characters, the scan concludes.

If the input string is AC, the output string will consist of 2 compression symbols: one for A and one for C. When examining the dictionary input for character A, the system determines that A's second child character matches the next input character, C, and so looks at entry X'101'. Because that entry has an additional extension character, but the input string does not contain this character, no match is made, and the output is the compression symbol for A. Processing character C results in the compression symbol for C.

If the input string is AC1, the output string will consist of 1 compression symbol. When examining the dictionary input for character A, the system determines that A's second child character matches the next input character, C, and so looks at entry X'101'. Because that entry has an additional extension character, and the input string does contain this character, 1, a match is made, and the output is the compression symbol for AC1.

Similarly, the set of input strings longer than one character compressed by this dictionary are:
Hexadecimal Symbol
String
100
AB
101
AC1
200
AC1D12
201
AC1E1234

The compression symbol is the index of the dictionary entry. Based on this, you can see that the expansion dictionary must result in the reverse processing; for example, if a compression symbol of X'201' is found, the output must be the string AC1E1234. See Expansion dictionary example for expansion dictionary processing.