To measure how randomly a set of consecutive terms are forming an N -gram, Tomokiyo and Hurst (Tomokiyo and Hurst, 2003) use pointwise divergence.
for an N -gram of size i, This equation shows the extent to which the terms forming g i have occurred together randomly.