Changes to WOLF

This commit is contained in:
DazedAnon 2024-09-18 08:45:08 -05:00
parent 05b4f57998
commit dd472cb89f
3 changed files with 140 additions and 107 deletions

View file

@ -2137,18 +2137,17 @@ def batchList(input_list, batch_size):
def createContext(fullPromptFlag, subbedT, format): def createContext(fullPromptFlag, subbedT, format):
characters = 'Game Characters:\n\ characters = 'Game Characters:\n\
リリアレット (Lilliete) - Female\n\ 圭太 (Keita) - Male\n\
ルディ (Rudy) - Male\n\ 涼香 (Ryoka) - Female\n\
マックス (Max) - Male\n\ (Saki) - Female\n\
ランベール (Lambert) - Male\n\ 大介 (Daisuke) - Male\n\
ミリエル (Miriel) - Female\n\ 浮浪者 (Vagrant) - Male\n\
マドレリー (Madorery) - Female\n\ まさる (Masaru) - Male\n\
シスター (Sister) - Female\n\ ノブオ (Nobuo) - Male\n\
踊り子さん (Dancer) - Female\n\ 安井 (Yasui) - Male\n\
自称勇者 (Self-Proclaimed Hero) - Male\n\ 大山 (Oyama) - Male\n\
甲冑 (Armor) - Male\n\ 関口 (Sekiguchi) - Male\n\
コレクター (Collector) - Male\n\ 黒崎 (Kurosaki) - Male\n\
ひげ (Whiskers) - Male\n\
' '
system = PROMPT + VOCAB if fullPromptFlag else \ system = PROMPT + VOCAB if fullPromptFlag else \

View file

@ -62,11 +62,11 @@ FILENAME = None
# Dialogue / Scroll # Dialogue / Scroll
CODE101 = False CODE101 = False
CODE102 = False CODE102 = False
CODE122 = True CODE122 = False
# Other # Other
CODE210 = False CODE210 = False
CODE300 = False CODE300 = True
CODE250 = False CODE250 = False
# Database # Database
@ -470,19 +470,19 @@ def searchCodes(events, pbar, jobList, filename):
### Event Code: 300 Common Events ### Event Code: 300 Common Events
if codeList[i]['code'] == 300 and CODE300 == True and len(codeList[i]['stringArgs']) > 0: if codeList[i]['code'] == 300 and CODE300 == True and len(codeList[i]['stringArgs']) > 0:
# Choices # Choices
if codeList[i]['stringArgs'][0] == "m_可変式選択肢": if codeList[i]['stringArgs'][0] == "[共]汎用ウィンドウ生成":
# Grab String # Grab String
choiceList = codeList[i]['stringArgs'][1].split('\r\n') choiceList = codeList[i]['stringArgs'][1].split('\r\n')
# Translate Question # # Translate Question
question = codeList[i]['stringArgs'][2] # question = codeList[i]['stringArgs'][2]
response = translateGPT(question, "", True) # response = translateGPT(question, "", True)
translatedText = response[0] # translatedText = response[0]
totalTokens[0] = response[1][0] # totalTokens[0] = response[1][0]
totalTokens[1] = response[1][1] # totalTokens[1] = response[1][1]
# Translate Question # # Translate Question
codeList[i]['stringArgs'][2] = translatedText # codeList[i]['stringArgs'][2] = translatedText
# Translate Choices # Translate Choices
response = translateGPT(choiceList, translatedText, True) response = translateGPT(choiceList, translatedText, True)
@ -504,7 +504,7 @@ def searchCodes(events, pbar, jobList, filename):
or codeList[i]['stringArgs'][0] == '[共]Hメッセージ+' \ or codeList[i]['stringArgs'][0] == '[共]Hメッセージ+' \
or codeList[i]['stringArgs'][0] == '[共]ポップアップ表示' \ or codeList[i]['stringArgs'][0] == '[共]ポップアップ表示' \
or codeList[i]['stringArgs'][0] == 'm_謎冒頭' \ or codeList[i]['stringArgs'][0] == 'm_謎冒頭' \
or (codeList[i]['codeStr'] == 'SetString' and '@' in codeList[i]['stringArgs'][0])\ or (codeList[i]['codeStr'] == 'SetString' and '\n' in codeList[i]['stringArgs'][0])\
or codeList[i]['stringArgs'][0] == '[移]サウンドノベル': or codeList[i]['stringArgs'][0] == '[移]サウンドノベル':
if len(codeList[i]['stringArgs']) > 1: if len(codeList[i]['stringArgs']) > 1:
cleanedList = formatDramon(codeList[i]['stringArgs'][1]) cleanedList = formatDramon(codeList[i]['stringArgs'][1])
@ -644,11 +644,11 @@ def searchCodes(events, pbar, jobList, filename):
return totalTokens return totalTokens
def formatDramon(jaString): def formatDramon(jaString):
imageRegex = r'(\r?\n?_\w+\r?\n?)|(@-?\d?\r\n)|(@-?\d?)([^\r]\d?-?\d?[^\r]+?)(\r\n|$)|(_PDC)|(>\r\n)|(^[#])|(\r\n@$)|(/)|(_SS_)|(\r\n[@/]-?\d?\r\n)' imageRegex = r'(\r?\n?_[a-zA-Z_\d/.]+\r?\n?)|(@-?\d?\r\n)|(@-?\d?)([^\r]\d?-?\d?[^\r]+?)(\r\n|$)|(_PDC)|(>\r\n)|(^[#])|(\r\n@$)|(/)|(_SS_)|(\r\n[@/]\s?-?\d?\r\n)'
jaString = jaString.replace('\u3000', ' ') jaString = jaString.replace('\u3000', ' ')
jaString = jaString.replace('#', '') jaString = jaString.replace('#', '')
jaString = re.sub(r'[^\r]\n', '\r\n', jaString) jaString = re.sub(r'([^\r])\n', r'\1\r\n', jaString)
# Grab and Split # Grab and Split
jaStringList = re.split(imageRegex, jaString) jaStringList = re.split(imageRegex, jaString)
@ -660,7 +660,7 @@ def formatDramon(jaString):
j = 0 j = 0
translatedText = '' translatedText = ''
while j < len(cleanedList): while j < len(cleanedList):
if ('@' in cleanedList[j] or '/' in cleanedList[j]) and j < len(cleanedList)-1 and re.search(r'([@/]-?\d?\r\n)', cleanedList[j]) is None: if ('@' in cleanedList[j] or '/' in cleanedList[j]) and j < len(cleanedList)-1 and re.search(r'([@/]-?\d?\r\n)', cleanedList[j]) is None and '.ogg' not in cleanedList[j]:
# Setup @ # Setup @
if j > 0 and '@' not in cleanedList[j-1] and '/' not in cleanedList[j-1] and '_' not in cleanedList[j-1]: if j > 0 and '@' not in cleanedList[j-1] and '/' not in cleanedList[j-1] and '_' not in cleanedList[j-1]:
cleanedList[j-1] = cleanedList[j-1] + cleanedList[j+1] cleanedList[j-1] = cleanedList[j-1] + cleanedList[j+1]
@ -820,15 +820,15 @@ def searchDB(events, pbar, jobList, filename):
scenarioList[2].pop(0) scenarioList[2].pop(0)
# Grab Items # Grab Items
if table['name'] == '商品' and ITEMFLAG == True: if table['name'] == 'm_モンスター用名前候補' and ITEMFLAG == True:
with open('translations.txt', 'a') as file: with open('translations.txt', 'a', encoding='utf-8') as file:
for item in table['data']: for item in table['data']:
dataList = item['data'] dataList = item['data']
# Parse # # Parse #
for j in range(len(dataList)): for j in range(len(dataList)):
# Name # Name
if '商品の名前' in dataList[j].get('name'): if dataList[j].get('name') == '名前':
# Pass 1 (Grab Data) # Pass 1 (Grab Data)
if setData == False: if setData == False:
if dataList[j].get('value') != '': if dataList[j].get('value') != '':
@ -841,86 +841,122 @@ def searchDB(events, pbar, jobList, filename):
dataList[j].update({'value': itemList[0][0]}) dataList[j].update({'value': itemList[0][0]})
itemList[0].pop(0) itemList[0].pop(0)
# Description # Description 1 (You are my specialz)
if dataList[j].get('name') == 'NULL': if dataList[j].get('name') == 'NULL':
# Pass 1 (Grab Data) # Clean String
if setData == False: fontSize = 24
if dataList[j].get('value') != '': translatedText = ''
# Remove Textwrap cleanedList = formatDramon(dataList[j].get('value'))
jaString = dataList[j].get('value') for str in cleanedList:
jaString = jaString.replace('\n', ' ') # Pass 1
jaString = jaString.replace('\r', '') if not setData:
jaString = re.sub(r'[\\]+f\[\d+\]', '', jaString) if all(x not in str for x in ['_', '@', '>', '/']) and str != '\r\n':
# Remove Textwrap and Font and Add to list
str = str.replace('\r\n', ' ')
str = str.replace(f'\\f[{fontSize}]', '')
itemList[1].append(str)
# Append Data # Pass 2
itemList[1].append(jaString) else:
if all(x not in str for x in ['_', '@', '>', '/',]) and str != '\r\n':
# Decide Wrap
width = WIDTH
# Pass 2 (Set Data) # Add Textwrap and Font
else: tempText = itemList[1][0]
if dataList[j].get('value') != '': # tempText = textwrap.fill(tempText, width)
# Textwrap # tempText = tempText.replace('\n', f'\r\n\\f[{fontSize}]')
translatedText = itemList[1][0] # tempText = f'\\f[{fontSize}]{tempText}\r\n'
translatedText = textwrap.fill(translatedText, LISTWIDTH) translatedText += tempText
translatedText = translatedText.replace('\n', '\r\n') itemList[1].pop(0)
translatedText = font + translatedText.replace('\r\n', f'\r\n{font}') else:
translatedText += str
# Set Data # Write to File
dataList[j].update({'value': translatedText}) if setData:
itemList[1].pop(0) # Formatting Fixes
translatedText = translatedText.replace('*"', '* "')
translatedText = translatedText.replace('\r\n\r\n', '\r\n')
translatedText = re.sub(r'[^\S\r\n]+', ' ', translatedText)
dataList[j].update({'value': translatedText})
# Description 2 # Description 2 (You are my specialz)
if dataList[j].get('name') == 'NULL': if dataList[j].get('name') == 'NULL':
# Pass 1 (Grab Data) # Clean String
if setData == False: fontSize = 24
if dataList[j].get('value') != '': translatedText = ''
# Remove Textwrap cleanedList = formatDramon(dataList[j].get('value'))
jaString = dataList[j].get('value') for str in cleanedList:
jaString = jaString.replace('\n', ' ') # Pass 1
jaString = jaString.replace('\r', '') if not setData:
jaString = re.sub(r'[\\]+f\[\d+\]', '', jaString) if all(x not in str for x in ['_', '@', '>', '/']) and str != '\r\n':
# Remove Textwrap and Font and Add to list
str = str.replace('\r\n', ' ')
str = str.replace(f'\\f[{fontSize}]', '')
itemList[2].append(str)
# Append Data # Pass 2
itemList[2].append(jaString) else:
if all(x not in str for x in ['_', '@', '>', '/',]) and str != '\r\n':
# Decide Wrap
width = WIDTH
# Pass 2 (Set Data) # Add Textwrap and Font
else: tempText = itemList[2][0]
if dataList[j].get('value') != '': # tempText = textwrap.fill(tempText, width)
# Textwrap # tempText = tempText.replace('\n', f'\r\n\\f[{fontSize}]')
translatedText = itemList[2][0] # tempText = f'\\f[{fontSize}]{tempText}\r\n'
translatedText = textwrap.fill(translatedText, LISTWIDTH) translatedText += tempText
translatedText = translatedText.replace('\n', '\r\n') itemList[2].pop(0)
translatedText = font + translatedText.replace('\r\n', f'\r\n{font}') else:
translatedText += str
# Set Data # Write to File
dataList[j].update({'value': translatedText}) if setData:
itemList[2].pop(0) # Formatting Fixes
translatedText = translatedText.replace('*"', '* "')
translatedText = translatedText.replace('\r\n\r\n', '\r\n')
translatedText = re.sub(r'[^\S\r\n]+', ' ', translatedText)
dataList[j].update({'value': translatedText})
# Description 3 # Description 3 (You are my specialz)
if dataList[j].get('name') == 'NULL': if dataList[j].get('name') == 'NULL':
# Pass 1 (Grab Data) # Clean String
if setData == False: fontSize = 24
if dataList[j].get('value') != '': translatedText = ''
# Remove Textwrap cleanedList = formatDramon(dataList[j].get('value'))
jaString = dataList[j].get('value') for str in cleanedList:
jaString = jaString.replace('\n', ' ') # Pass 1
jaString = jaString.replace('\r', '') if not setData:
jaString = re.sub(r'[\\]+f\[\d+\]', '', jaString) if all(x not in str for x in ['_', '@', '>', '/']) and str != '\r\n':
# Remove Textwrap and Font and Add to list
str = str.replace('\r\n', ' ')
str = str.replace(f'\\f[{fontSize}]', '')
itemList[3].append(str)
# Append Data # Pass 2
itemList[3].append(jaString) else:
if all(x not in str for x in ['_', '@', '>', '/',]) and str != '\r\n':
# Decide Wrap
width = WIDTH
# Pass 2 (Set Data) # Add Textwrap and Font
else: tempText = itemList[3][0]
if dataList[j].get('value') != '': # tempText = textwrap.fill(tempText, width)
# Textwrap # tempText = tempText.replace('\n', f'\r\n\\f[{fontSize}]')
translatedText = itemList[3][0] # tempText = f'\\f[{fontSize}]{tempText}\r\n'
translatedText = textwrap.fill(translatedText, LISTWIDTH) translatedText += tempText
translatedText = translatedText.replace('\n', '\r\n') itemList[3].pop(0)
translatedText = font + translatedText.replace('\r\n', f'\r\n{font}') else:
translatedText += str
# Set Data # Write to File
dataList[j].update({'value': translatedText}) if setData:
itemList[3].pop(0) # Formatting Fixes
translatedText = translatedText.replace('*"', '* "')
translatedText = translatedText.replace('\r\n\r\n', '\r\n')
translatedText = re.sub(r'[^\S\r\n]+', ' ', translatedText)
dataList[j].update({'value': translatedText})
# Grab Armors # Grab Armors
if table['name'] == '防具' and ARMORFLAG == True: if table['name'] == '防具' and ARMORFLAG == True:
@ -1287,7 +1323,7 @@ def searchDB(events, pbar, jobList, filename):
pbar.refresh() pbar.refresh()
# Name # Name
response = translateGPT(armorList[0], 'Reply with only the '+ LANGUAGE +' translation of the RPG item name', True) response = translateGPT(armorList[0], 'Reply with only the '+ LANGUAGE +' translation of the NPC name', True)
nameListTL = response[0] nameListTL = response[0]
totalTokens[0] += response[1][0] totalTokens[0] += response[1][0]
totalTokens[1] += response[1][1] totalTokens[1] += response[1][1]

View file

@ -2,9 +2,9 @@ Here are some vocabulary and terms so that you know the proper spelling and tran
``` ```
# Lewd Terms # Lewd Terms
マンコ (pussy) マンコ (pussy)
おまんこ (pussy) おまんこ (vagina)
お尻 (butt)
尻 (ass) 尻 (ass)
お尻 (butt)
お股 (crotch) お股 (crotch)
秘部 (genitals) 秘部 (genitals)
チンポ (dick) チンポ (dick)
@ -17,8 +17,11 @@ Here are some vocabulary and terms so that you know the proper spelling and tran
君, くん (kun) 君, くん (kun)
ちゃん (chan) ちゃん (chan)
たん (tan) たん (tan)
先輩, せんぱい (senpai) 先輩 (senpai)
先生, せんせい (sensei) せんぱい (senpai)
先生 (sensei)
師匠 (shishou)
せんせい (sensei)
お兄ちゃん (Onii-chan) お兄ちゃん (Onii-chan)
お姉ちゃん (Onee-chan) お姉ちゃん (Onee-chan)
@ -45,7 +48,7 @@ ME 音量 (ME Volume)
エクスポーション (EX Potion) エクスポーション (EX Potion)
アスカロン (Ascalon) アスカロン (Ascalon)
# Other # Terms
悪魔 (Devil) 悪魔 (Devil)
上級悪魔 (Arch Devil) 上級悪魔 (Arch Devil)
歪魔 (Distorted Devil) 歪魔 (Distorted Devil)
@ -63,10 +66,5 @@ ME 音量 (ME Volume)
飛天魔 (Nephilim) 飛天魔 (Nephilim)
堕天使 (Fallen Angel) 堕天使 (Fallen Angel)
鬼 (Oni) 鬼 (Oni)
ギャンデッド (Ganded)
リーロランド (Liloland)
ローバー (Roper) ローバー (Roper)
タリホー (Tariho)
``` ```