1. A computer-implemented method comprising: receiving, at a computing system including one or more processors, a plurality of n-grams, each n-gram representing a sequence of one or more consecutive words, and each n-gram being associated with a value for a parameter related to a probability of the n-gram with respect to a corpus; determining, at the computing system, a fingerprint for each of the plurality of n-grams to obtain a plurality of fingerprints, each fingerprint representing a distinct index for a specific n-gram; identifying, at the computing system, a location in an array for each of the plurality of n-grams using a perfect hash function to obtain a plurality of locations, wherein the array associates the plurality of fingerprints with the plurality of n-grams, respectively; and encoding, at the computing system, the value of the parameter for each of the plurality of n-grams in the array to obtain a modified array, wherein the value of the parameter for a specific n-gram is encoded at a specific location in the array that is associated with the specific n-gram.