Added the mode as the return type of the docts and frags
Added doct text test