phrase and trend calculation