Update to generateCorpora. Bugfix for train. Typo fix for filterForSorting