Processing a corpus at a time to limit memory usage