adding new corpus and document functions