code: def saveData(self, dataOutputFile, categoriesOutputFile):
      
      if self.records is None:
        return False
  
      if not dataOutputFile.endswith("csv"):
        raise TypeError("data output file must be csv.")
      if not categoriesOutputFile.endswith("json"):
        raise TypeError("category output file must be json")
  
      # Ensure directory exists
      dataOutputDirectory = os.path.dirname(dataOutputFile)
      if not os.path.exists(dataOutputDirectory):
        os.makedirs(dataOutputDirectory)
  
      categoriesOutputDirectory = os.path.dirname(categoriesOutputFile)
      if not os.path.exists(categoriesOutputDirectory):
        os.makedirs(categoriesOutputDirectory)
  
      with open(dataOutputFile, "w") as f:
        # Header
        writer = csv.DictWriter(f, fieldnames=self.fieldNames)
        writer.writeheader()
  
        # Types
        writer.writerow(self.types)
  
        # Special characters
        writer.writerow(self.specials)
  
        for data in self.records:
          for record in data:
            writer.writerow(record)
  
      with open(categoriesOutputFile, "w") as f:
        f.write(json.dumps(self.categoryToId,
                           sort_keys=True,
                           indent=4,
                           separators=(",", ": ")))
  
      return dataOutputFile
docs: Save the processed data and the associated category mapping.
      @param dataOutputFile       (str)   Location to save data
      @param categoriesOutputFile (str)   Location to save category map
      @return                     (str)   Path to the saved data file iff
                                          saveData() is successful.