moved ngram extraction to traversal function of document_loader