Merge pull request #1398 from KilianKegel:master

PiperOrigin-RevId: 875661415
diff --git a/research/dictionary_generator.cc b/research/dictionary_generator.cc
index 7047328..e1aa46b 100644
--- a/research/dictionary_generator.cc
+++ b/research/dictionary_generator.cc
@@ -281,6 +281,10 @@
         const char* resolved_path = resolved_paths.gl_pathv[j];
 #endif
         std::string content = readFile(resolved_path);
+        if (content.empty()) {
+          fprintf(stderr, "Skipping empty sample: %s\n", resolved_path);
+          continue;
+        }
         if (chunkLen == 0) {
           paths.emplace_back(resolved_path);
           data.insert(data.end(), content.begin(), content.end());