changeunits() for corpus

Added a function to reshape a corpus into paragraphs or sentences,
called changeunits(). (Maybe we could think of a better name!)

Also corrected a problem in segment.corpus().