<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_text_path(self):
 """ Returns the path of the directory containing text if they exist in this dataset. """

        for res in self.dsDoc['dataResources']:
            resPath = res['resPath']
            resType = res['resType']
            isCollection = res['isCollection']
            if resType == 'text' and isCollection:
                return os.path.join(self.dsHome, resPath)

        # if the for loop is over and no image directory is found, then return None
        raise RuntimeError('could not find learningData file the dataset')