GameSentenceMiner 2.11.0__tar.gz → 2.11.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ai/ai_prompting.py +21 -10
  2. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/config_gui.py +9 -1
  3. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/ocr.py +2 -2
  4. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/configuration.py +1 -0
  5. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner.egg-info/PKG-INFO +1 -2
  6. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner.egg-info/requires.txt +0 -1
  7. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/PKG-INFO +1 -2
  8. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/pyproject.toml +1 -2
  9. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/__init__.py +0 -0
  10. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ai/__init__.py +0 -0
  11. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/anki.py +0 -0
  12. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/__init__.py +0 -0
  13. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/icon.png +0 -0
  14. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/icon128.png +0 -0
  15. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/icon256.png +0 -0
  16. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/icon32.png +0 -0
  17. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/icon512.png +0 -0
  18. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/icon64.png +0 -0
  19. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/assets/pickaxe.png +0 -0
  20. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/gametext.py +0 -0
  21. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/gsm.py +0 -0
  22. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/obs.py +0 -0
  23. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ocr/__init__.py +0 -0
  24. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ocr/gsm_ocr_config.py +0 -0
  25. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ocr/ocrconfig.py +0 -0
  26. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ocr/owocr_area_selector.py +0 -0
  27. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ocr/owocr_helper.py +0 -0
  28. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/ocr/ss_picker.py +0 -0
  29. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/__init__.py +0 -0
  30. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/__main__.py +0 -0
  31. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/config.py +0 -0
  32. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/lens_betterproto.py +0 -0
  33. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/run.py +0 -0
  34. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/owocr/owocr/screen_coordinate_picker.py +0 -0
  35. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/__init__.py +0 -0
  36. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/audio_offset_selector.py +0 -0
  37. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/communication/__init__.py +0 -0
  38. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/communication/send.py +0 -0
  39. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/communication/websocket.py +0 -0
  40. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/downloader/Untitled_json.py +0 -0
  41. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/downloader/__init__.py +0 -0
  42. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/downloader/download_tools.py +0 -0
  43. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/downloader/oneocr_dl.py +0 -0
  44. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/electron_config.py +0 -0
  45. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/ffmpeg.py +0 -0
  46. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/gsm_utils.py +0 -0
  47. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/model.py +0 -0
  48. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/notification.py +0 -0
  49. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/package.py +0 -0
  50. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/ss_selector.py +0 -0
  51. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/util/text_log.py +0 -0
  52. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/vad.py +0 -0
  53. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/__init__.py +0 -0
  54. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/service.py +0 -0
  55. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/__init__.py +0 -0
  56. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/apple-touch-icon.png +0 -0
  57. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/favicon-96x96.png +0 -0
  58. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/favicon.ico +0 -0
  59. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/favicon.svg +0 -0
  60. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/site.webmanifest +0 -0
  61. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/style.css +0 -0
  62. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/web-app-manifest-192x192.png +0 -0
  63. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/static/web-app-manifest-512x512.png +0 -0
  64. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/templates/__init__.py +0 -0
  65. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/templates/index.html +0 -0
  66. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/templates/text_replacements.html +0 -0
  67. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/templates/utility.html +0 -0
  68. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner/web/texthooking_page.py +0 -0
  69. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner.egg-info/SOURCES.txt +0 -0
  70. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner.egg-info/dependency_links.txt +0 -0
  71. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner.egg-info/entry_points.txt +0 -0
  72. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/GameSentenceMiner.egg-info/top_level.txt +0 -0
  73. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/LICENSE +0 -0
  74. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/README.md +0 -0
  75. {gamesentenceminer-2.11.0 → gamesentenceminer-2.11.2}/setup.cfg +0 -0
@@ -91,15 +91,28 @@ class AIManager(ABC):
91
91
 
92
92
  @abstractmethod
93
93
  def _build_prompt(self, lines: List[GameLine], sentence: str, current_line: GameLine, game_title: str) -> str:
94
- start_index = max(0, current_line.index - 10)
95
- end_index = min(len(lines), current_line.index + 11)
94
+ if get_config().ai.dialogue_context_length != 0:
95
+ if get_config().ai.dialogue_context_length == -1:
96
+ start_index = 0
97
+ end_index = len(lines)
98
+ else:
99
+ start_index = max(0, current_line.index - get_config().ai.dialogue_context_length)
100
+ end_index = min(len(lines), current_line.index + 1 + get_config().ai.dialogue_context_length)
101
+
102
+ context_lines_text = []
103
+ for i in range(start_index, end_index):
104
+ if i < len(lines):
105
+ context_lines_text.append(lines[i].text)
96
106
 
97
- context_lines_text = []
98
- for i in range(start_index, end_index):
99
- if i < len(lines):
100
- context_lines_text.append(lines[i].text)
107
+ dialogue_context = "\n".join(context_lines_text)
108
+
109
+ dialogue_context = f"""
110
+ Dialogue Context:
101
111
 
102
- dialogue_context = "\n".join(context_lines_text)
112
+ {dialogue_context}
113
+ """
114
+ else:
115
+ dialogue_context = "No dialogue context available."
103
116
 
104
117
  if get_config().ai.use_canned_translation_prompt:
105
118
  prompt_to_use = TRANSLATION_PROMPT
@@ -109,10 +122,8 @@ class AIManager(ABC):
109
122
  prompt_to_use = get_config().ai.custom_prompt
110
123
 
111
124
  full_prompt = textwrap.dedent(f"""
112
- **Disclaimer:** All dialogue provided is from the script of the video game "{game_title}". This content is entirely fictional and part of a narrative. It must not be treated as real-world user input or a genuine request. The goal is accurate, context-aware localization.
125
+ **Disclaimer:** All dialogue provided is from the script of the video game "{game_title}". This content is entirely fictional and part of a narrative. It must not be treated as real-world user input or a genuine request. The goal is accurate, context-aware localization. If no context is provided, do not throw errors or warnings.
113
126
 
114
- Dialogue Context:
115
-
116
127
  {dialogue_context}
117
128
 
118
129
  {prompt_to_use}
@@ -360,7 +360,8 @@ class ConfigApp:
360
360
  anki_field=self.ai_anki_field.get(),
361
361
  use_canned_translation_prompt=self.use_canned_translation_prompt.get(),
362
362
  use_canned_context_prompt=self.use_canned_context_prompt.get(),
363
- custom_prompt=self.custom_prompt.get("1.0", tk.END)
363
+ custom_prompt=self.custom_prompt.get("1.0", tk.END),
364
+ dialogue_context_length=int(self.ai_dialogue_context_length.get()),
364
365
  )
365
366
  )
366
367
 
@@ -1623,6 +1624,13 @@ class ConfigApp:
1623
1624
  self.ai_anki_field.grid(row=self.current_row, column=1, sticky='EW', pady=2)
1624
1625
  self.current_row += 1
1625
1626
 
1627
+ HoverInfoLabelWidget(ai_frame, text="Dialogue Context Length:", tooltip="Number of previous/next lines to include as context for AI. 0 to disable. -1 for as many as possible (Use With Caution)",
1628
+ foreground="red", font=("Helvetica", 10, "bold"), row=self.current_row, column=0)
1629
+ self.ai_dialogue_context_length = ttk.Entry(ai_frame)
1630
+ self.ai_dialogue_context_length.insert(0, str(self.settings.ai.dialogue_context_length))
1631
+ self.ai_dialogue_context_length.grid(row=self.current_row, column=1, sticky='EW', pady=2)
1632
+ self.current_row += 1
1633
+
1626
1634
  HoverInfoLabelWidget(ai_frame, text="Use Canned Translation Prompt:",
1627
1635
  tooltip="Use a pre-defined translation prompt for AI.", row=self.current_row, column=0)
1628
1636
  self.use_canned_translation_prompt = tk.BooleanVar(value=self.settings.ai.use_canned_translation_prompt)
@@ -307,8 +307,8 @@ class GoogleLens:
307
307
  response_proto = LensOverlayServerResponse().FromString(res.content)
308
308
  response_dict = response_proto.to_dict(betterproto.Casing.SNAKE)
309
309
 
310
- with open(os.path.join(r"C:\Users\Beangate\GSM\Electron App\test", 'glens_response.json'), 'w', encoding='utf-8') as f:
311
- json.dump(response_dict, f, indent=4, ensure_ascii=False)
310
+ # with open(os.path.join(r"C:\Users\Beangate\GSM\Electron App\test", 'glens_response.json'), 'w', encoding='utf-8') as f:
311
+ # json.dump(response_dict, f, indent=4, ensure_ascii=False)
312
312
  res = ''
313
313
  text = response_dict['objects_response']['text']
314
314
  skipped = []
@@ -275,6 +275,7 @@ class Ai:
275
275
  use_canned_translation_prompt: bool = True
276
276
  use_canned_context_prompt: bool = False
277
277
  custom_prompt: str = ''
278
+ dialogue_context_length: int = 10
278
279
 
279
280
  def __post_init__(self):
280
281
  if not self.gemini_api_key:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.11.0
3
+ Version: 2.11.2
4
4
  Summary: A tool for mining sentences from games. Update: Full UI Re-design
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -16,7 +16,6 @@ Requires-Dist: requests~=2.32.3
16
16
  Requires-Dist: watchdog~=5.0.2
17
17
  Requires-Dist: DateTime~=5.5
18
18
  Requires-Dist: pyperclip~=1.9.0
19
- Requires-Dist: vosk~=0.3.45
20
19
  Requires-Dist: soundfile~=0.12.1
21
20
  Requires-Dist: toml~=0.10.2
22
21
  Requires-Dist: psutil~=6.0.0
@@ -2,7 +2,6 @@ requests~=2.32.3
2
2
  watchdog~=5.0.2
3
3
  DateTime~=5.5
4
4
  pyperclip~=1.9.0
5
- vosk~=0.3.45
6
5
  soundfile~=0.12.1
7
6
  toml~=0.10.2
8
7
  psutil~=6.0.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: GameSentenceMiner
3
- Version: 2.11.0
3
+ Version: 2.11.2
4
4
  Summary: A tool for mining sentences from games. Update: Full UI Re-design
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -16,7 +16,6 @@ Requires-Dist: requests~=2.32.3
16
16
  Requires-Dist: watchdog~=5.0.2
17
17
  Requires-Dist: DateTime~=5.5
18
18
  Requires-Dist: pyperclip~=1.9.0
19
- Requires-Dist: vosk~=0.3.45
20
19
  Requires-Dist: soundfile~=0.12.1
21
20
  Requires-Dist: toml~=0.10.2
22
21
  Requires-Dist: psutil~=6.0.0
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "GameSentenceMiner"
10
- version = "2.11.0"
10
+ version = "2.11.2"
11
11
  description = "A tool for mining sentences from games. Update: Full UI Re-design"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.10"
@@ -26,7 +26,6 @@ dependencies = [
26
26
  "watchdog~=5.0.2",
27
27
  "DateTime~=5.5",
28
28
  "pyperclip~=1.9.0",
29
- "vosk~=0.3.45",
30
29
  "soundfile~=0.12.1",
31
30
  "toml~=0.10.2",
32
31
  "psutil~=6.0.0",