4. The non-transitory computer-readable recording medium according to claim 1 , wherein the plurality of pieces of syntax information are information in which a tree structure of a syntax tree indicating relationships between the plurality of words are expressed using a plurality of subtrees.
1. A non-transitory computer-readable recording medium having stored therein an encoding program that causes a computer to execute a process comprising: generating a plurality of pieces of syntax information respectively corresponding to a plurality of words in a compression target document by analyzing relationships between the plurality of words; assigning a plurality of compression codes to the plurality of words and to the plurality of pieces of syntax information; and outputting the plurality of compression codes with an arrangement of a specific order.