diff --git a/modules/main.py b/modules/main.py index a571659..8c92dc2 100644 --- a/modules/main.py +++ b/modules/main.py @@ -50,7 +50,7 @@ from modules.wolf2 import handleWOLF2 from modules.javascript import handleJavascript from modules.irissoft import handleIris from modules.regex import handleRegex -from modules.linebyline import handleText +from modules.text import handleText from modules.renpy import handleRenpy from modules.unity import handleUnity from modules.images import handleImages @@ -81,7 +81,7 @@ MODULES = [ ["Javascript", ["js"], handleJavascript], ["Iris", ["txt"], handleIris], ["Regex", ["txt", "json", "script"], handleRegex], - ["Line By Line", ["txt"], handleText], + ["Text", ["txt", "srt"], handleText], ["Renpy", ["rpy"], handleRenpy], ["Unity", ["txt"], handleUnity], ["Images", [""], handleImages], diff --git a/modules/linebyline.py b/modules/text.py similarity index 98% rename from modules/linebyline.py rename to modules/text.py index d6a5838..b3e702b 100644 --- a/modules/linebyline.py +++ b/modules/text.py @@ -59,7 +59,7 @@ if "gpt-3.5" in MODEL: elif "gpt-4" in MODEL: INPUTAPICOST = 0.0025 OUTPUTAPICOST = 0.01 - BATCHSIZE = 20 + BATCHSIZE = 30 def handleText(filename, estimate): global ESTIMATE, TOKENS, FILENAME @@ -190,7 +190,7 @@ def translateTxt(data, translatedList): i = 0 while i < len(data): - lineTextRegex = r"(.*)" + lineTextRegex = r"(.+)" # Dialogue match = re.search(lineTextRegex, data[i]) @@ -198,7 +198,6 @@ def translateTxt(data, translatedList): if match: # Set String jaString = match.group(1) - originalString = jaString # Pass 1 if not translatedList: @@ -228,10 +227,6 @@ def translateTxt(data, translatedList): r"^\[?(.+?)\]?\s?[|:]\s?", "", translatedText ) - # Escape Quotes - translatedText = re.sub(r'(?