Пример #1
0
 def _validate_metadata(self):
     # If we don't have a metadata path, we have nothing to do.
     if not os.path.exists(self.metadata_path):
         self.metadata_path = None
         return
     # Get the expected metadata paths for all available Importers.
     expected_paths = Importers.get_metadata_paths_for_all_modules(
         {"model_path": self.name})
     # If we have actual metadata paths that match the expected paths,
     # note that we have that type of metadata for this corpus.
     for path in os.listdir(self.metadata_path):
         full_path = os.path.join(path, self.metadata_path)
         if full_path in expected_paths.keys():
             self.metadata = expected_paths[full_path]
Пример #2
0
 def _validate_metadata(self):
     # If we don't have a metadata path, we have nothing to do.
     if not os.path.exists(self.metadata_path):
         self.metadata_path = None
         return
     # Get the expected metadata paths for all available Importers.
     expected_paths = Importers.get_metadata_paths_for_all_modules({
         "model_path": self.name
     })
     # If we have actual metadata paths that match the expected paths,
     # note that we have that type of metadata for this corpus.
     for path in os.listdir(self.metadata_path):
         full_path = os.path.join(path, self.metadata_path)
         if full_path in expected_paths.keys():
             self.metadata = expected_paths[full_path]