fix text corpus structure