Add logging for mismatch errors

This commit is contained in:
dazedanon 2025-04-09 15:35:45 -05:00
parent 76b1da7d4d
commit 9bd619e3e8
15 changed files with 79 additions and 15 deletions

View file

@ -707,7 +707,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -561,7 +561,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -605,7 +605,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -623,7 +623,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -626,7 +626,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -544,7 +544,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -2612,7 +2612,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -2720,7 +2720,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -833,7 +833,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -533,7 +533,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -622,7 +622,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -535,7 +535,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -2604,7 +2604,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -572,7 +572,11 @@ def translateGPT(text, history, fullPromptFlag):
if isinstance(tItem, list):
extractedTranslations = extractTranslation(translatedText, True)
if extractedTranslations == None or len(tItem) != len(extractedTranslations):
mismatch = True # Just here for breakpoint
with open("log/mismatchHistory.txt", "a+", encoding="utf-8") as mismatchFile:
mismatchFile.write(f"Mismatch: {FILENAME}\n")
mismatchFile.write(f"Input:\n{subbedT}\n")
mismatchFile.write(f"Output:\n{translatedText}\n")
mismatch = True # Just here for breakpoint
logFile.write(f"Input:\n{subbedT}\n")
logFile.write(f"Output:\n{translatedText}\n")

View file

@ -1,7 +1,15 @@
Here are some vocabulary and terms so that you know the proper spelling and translation.
```
# Game Characters
アリシア (Alicia) - Female
セレト (Sereto) - Male
メア (Mea) - Female
リリリ (Lilili) - Female
デイ (Dei) - Female
ルーシィ (Lucy) - Female
セビナ (Sebina) - Female
アビー (Abby) - Female
マリステラ (Maristella) - Female
レミ (Remy) - Female
# Lewd Terms
マンコ (pussy)