The basic PHP N-gram Functions These short functions, combined with an extensive set of finger-prints, do all the work for a Statistical Language Detection. There's also a simple script at the bottom of this page