1. A data compression method for generating compressed data by performing a compression process on a data string to be compressed, comprising the steps of: setting a plurality of consecutive characters, which are contained in the data string, as a character string to be searched; allocating bits of a bit string representing said character string to at least two codewords to thereby generate first and second searching codewords; obtaining first and second array contents from first and second array tables, in which information on past occurrence positions of character strings is previously stored, by using said first and second searching codewords as array addresses; collating the obtained first and second array contents with each other; and obtaining past occurrence position information corresponding to said character string according to said first and second array contents when the first and second array contents match with each other.