Builds an N-Gram model for language detection.