Sorting by language and preliminary cleaning