Updated script with a workaround for broken ngrams files.