even more debug output added

This commit is contained in:
FeralChild64 committed 2020-06-25 18:37:33 +02:00
1 parent e442fa366f
commit cba3a8949f
1 file changed
+10 -3
+10 -3
View File
@@ -616,6 +616,8 @@ void DictEncoder::extractWords(std::vector<std::string> &candidateList)
int32_t DictEncoder::evaluateCandidate(std::string &candidate) int32_t DictEncoder::evaluateCandidate(std::string &candidate)
{ {
// XXX it looks like this is not 100% right - debug the algorithm if dictionary compression is reintroduced
// Build the score - find how much bytes can be spared by extracting this particular candidate // Build the score - find how much bytes can be spared by extracting this particular candidate
// Limited size of the dictionary is taken into consideration // Limited size of the dictionary is taken into consideration
@@ -1548,13 +1550,15 @@ void DataSet::prepareOutput_packed(std::ostringstream &stream,
{ {
if (lastStr != LastStr::NONE) stream << std::endl; if (lastStr != LastStr::NONE) stream << std::endl;
// Output the label - as a comment
if (stringEntryList.type != ListType::DICTIONARY) if (stringEntryList.type != ListType::DICTIONARY)
{ {
stream << "\t// IDX__" << stringEntryList.list[idxString].alias << std::endl; stream << "\t// IDX__" << stringEntryList.list[idxString].alias << std::endl;
} }
if (!isCompressionLvl2(stringEntryList)) // Output the source string - as a comment
{
stream << "\t// '"; stream << "\t// '";
for (auto &character : stringEntryList.list[idxString].string) for (auto &character : stringEntryList.list[idxString].string)
{ {
@@ -1572,7 +1576,8 @@ void DataSet::prepareOutput_packed(std::ostringstream &stream,
} }
} }
stream << "'" << std::endl; stream << "'" << std::endl;
}
// Output the encoding
stream << "\t.byte "; stream << "\t.byte ";
@@ -1630,6 +1635,8 @@ void DataSet::prepareOutput()
const auto &stringEntryList = stringEntryLists[idx]; const auto &stringEntryList = stringEntryLists[idx];
const auto &stringEncodedList = stringEncodedLists[idx]; const auto &stringEncodedList = stringEncodedLists[idx];
if (stringEncodedList.empty()) continue;
// Export labels for the current list // Export labels for the current list
prepareOutput_labels(stream, stringEntryList, stringEncodedList); prepareOutput_labels(stream, stringEntryList, stringEncodedList);