getFragments function

Gets transcript fragments in a given format