GameSentenceMiner 2.4.3__py3-none-any.whl → 2.4.4__py3-none-any.whl

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.
@@ -181,12 +181,13 @@ def trim_audio_based_on_last_line(untrimmed_audio, video_path, game_line, next_l
181
181
  file_length = get_video_duration(video_path)
182
182
  time_delta = file_mod_time - game_line.time
183
183
  # Convert time_delta to FFmpeg-friendly format (HH:MM:SS.milliseconds)
184
- total_seconds = file_length - time_delta.total_seconds() + get_config().audio.beginning_offset
184
+ total_seconds = file_length - time_delta.total_seconds()
185
+ total_seconds_after_offset = total_seconds + get_config().audio.beginning_offset
185
186
  if total_seconds < 0 or total_seconds >= file_length:
186
187
  logger.info(f"0 seconds trimmed off of beginning")
187
188
  return untrimmed_audio
188
189
 
189
- hours, remainder = divmod(total_seconds, 3600)
190
+ hours, remainder = divmod(total_seconds_after_offset, 3600)
190
191
  minutes, seconds = divmod(remainder, 60)
191
192
  start_trim_time = "{:02}:{:02}:{:06.3f}".format(int(hours), int(minutes), seconds)
192
193
 
@@ -210,7 +211,7 @@ def trim_audio_based_on_last_line(untrimmed_audio, video_path, game_line, next_l
210
211
  logger.debug(" ".join(ffmpeg_command))
211
212
  subprocess.run(ffmpeg_command)
212
213
 
213
- logger.info(f"{total_seconds} trimmed off of beginning")
214
+ logger.info(f"{total_seconds_after_offset} trimmed off of beginning")
214
215
 
215
216
  logger.info(f"Audio trimmed and saved to {trimmed_audio}")
216
217
  return trimmed_audio
@@ -156,70 +156,10 @@ def start_text_monitor(send_to_mine_event_bus):
156
156
  text_thread.start()
157
157
 
158
158
 
159
- # def get_line_timing(last_note):
160
- # def similar(a, b):
161
- # return SequenceMatcher(None, a, b).ratio()
162
- #
163
- # if not last_note:
164
- # return current_line_time, 0
165
- #
166
- # lines = line_history.values
167
- #
168
- # line_time = current_line_time
169
- # next_line = 0
170
- # prev_clip_time = 0
171
- #
172
- # try:
173
- # sentence = last_note['fields'][get_config().anki.sentence_field]['value']
174
- # if sentence:
175
- # for line in reversed(lines):
176
- # similarity = similar(remove_html_tags(sentence), line.text)
177
- # if similarity >= 0.60 or line.text in remove_html_tags(sentence): # 80% similarity threshold
178
- # line_time = line.time
179
- # next_line = prev_clip_time
180
- # break
181
- # prev_clip_time = line.time
182
- # except Exception as e:
183
- # logger.error(f"Using Default clipboard/websocket timing - reason: {e}")
184
- #
185
- # return line_time, next_line
186
- #
187
- #
188
- # def get_last_two_sentences(last_note) -> (str, str):
189
- # def similar(a, b):
190
- # return SequenceMatcher(None, a, b).ratio()
191
- #
192
- # lines = line_history.values
193
- #
194
- # if not last_note:
195
- # return lines[-1].text if lines else '', lines[-2].text if len(lines) > 1 else ''
196
- #
197
- # sentence = last_note['fields'][get_config().anki.sentence_field]['value']
198
- # if not sentence:
199
- # return lines[-1].text if lines else '', lines[-2].text if len(lines) > 1 else ''
200
- #
201
- # current, previous = "", ""
202
- # found = False
203
- #
204
- # for line in reversed(lines):
205
- # similarity = similar(remove_html_tags(sentence), line.text)
206
- # logger.debug(f"Comparing: {remove_html_tags(sentence)} with {line.text} - Similarity: {similarity}")
207
- # if found:
208
- # previous = line.text
209
- # break
210
- # if similarity >= 0.60 or line.text in remove_html_tags(sentence):
211
- # found = True
212
- # current = line.text
213
- #
214
- # if not current or not previous:
215
- # logger.debug("Couldn't find lines in history, using last two lines")
216
- # return lines[-1].text if lines else '', lines[-2].text if len(lines) > 1 else ''
217
- #
218
- # return current, previous
219
-
220
159
  def similar(a, b):
221
160
  return SequenceMatcher(None, a, b).ratio()
222
161
 
162
+
223
163
  def get_text_event(last_note) -> GameLine:
224
164
  lines = line_history.values
225
165
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: GameSentenceMiner
3
- Version: 2.4.3
3
+ Version: 2.4.4
4
4
  Summary: A tool for mining sentences from games. Update: Multi-Line Mining! Fixed!
5
5
  Author-email: Beangate <bpwhelan95@gmail.com>
6
6
  License: MIT License
@@ -75,7 +75,7 @@ There are settings in GSM that may help accomodate for a poor hook, but if you e
75
75
 
76
76
  ### New Way as of 2.4.0
77
77
 
78
- Grab the latest Installer or Zip from [Releases](https://github.com/bpwhelan/GameSentenceMiner/releases), and then either run the installer or run GameSentenceMiner.exe.
78
+ Grab the latest Installer from [Releases](https://github.com/bpwhelan/GameSentenceMiner/releases).
79
79
 
80
80
  ### Old Way - Will still work for the forseeable future
81
81
 
@@ -2,8 +2,8 @@ GameSentenceMiner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
2
2
  GameSentenceMiner/anki.py,sha256=QBrA-WVQfK4KjKB2Wm1WDW7BlVy8MF6-1ByTApVzPVA,10576
3
3
  GameSentenceMiner/config_gui.py,sha256=RCZJwg5FQpx_J-8jS7v54ivKPBkjicHKpmzN2zh9yAA,51975
4
4
  GameSentenceMiner/configuration.py,sha256=fQNBQjmJn2ViBSYMFNuyC5CSklBk0xgMDSXC47CwDe0,14463
5
- GameSentenceMiner/ffmpeg.py,sha256=4nyl_kdXi_trzDyhhjSmszN0BlFF-McAFyOghvCyl34,11142
6
- GameSentenceMiner/gametext.py,sha256=AkK77s_orZrWYEZEDDN9V8vvwiyt_YKAlWS4hhYXUx4,8928
5
+ GameSentenceMiner/ffmpeg.py,sha256=P7rTOXYnwg2LWkXqC-pRNhoRIRUEU8EpV8IAfXFcFC4,11215
6
+ GameSentenceMiner/gametext.py,sha256=OA7kLGTYj-GDhumZvzFgzEZ5cDpYHPhTANjUSciOKIY,6753
7
7
  GameSentenceMiner/gsm.py,sha256=t6hGJZKfMgiwgYUy7zWHlfmwyyLD-_eOEBeiTPpMFxk,19331
8
8
  GameSentenceMiner/model.py,sha256=oh8VVT8T1UKekbmP6MGNgQ8jIuQ_7Rg4GPzDCn2kJo8,1999
9
9
  GameSentenceMiner/notification.py,sha256=WBaQWoPNhW4XqdPBUmxPBgjk0ngzH_4v9zMQ-XQAKC8,2010
@@ -18,9 +18,9 @@ GameSentenceMiner/vad/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
18
18
  GameSentenceMiner/vad/silero_trim.py,sha256=syDJX_KbFmdyFFtnQqYTD0tICsUCJizYhs-atPgXtxA,1549
19
19
  GameSentenceMiner/vad/vosk_helper.py,sha256=HifeXKbEMrs81ZuuGxS67yAghu8TMXUP6Oan9i9dTxw,5938
20
20
  GameSentenceMiner/vad/whisper_helper.py,sha256=bpR1HVnJRn9H5u8XaHBqBJ6JwIjzqn-Fajps8QmQ4zc,3411
21
- gamesentenceminer-2.4.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
- gamesentenceminer-2.4.3.dist-info/METADATA,sha256=66Gl-pWPnznGHiLO23WIcsxwj7xdtONTsaQZ_E-Kltc,10395
23
- gamesentenceminer-2.4.3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
24
- gamesentenceminer-2.4.3.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
25
- gamesentenceminer-2.4.3.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
26
- gamesentenceminer-2.4.3.dist-info/RECORD,,
21
+ gamesentenceminer-2.4.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
+ gamesentenceminer-2.4.4.dist-info/METADATA,sha256=tjgtg86q80_uZz6ZDFx90kN0r-RfB9PEbENBSEVp8wg,10324
23
+ gamesentenceminer-2.4.4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
24
+ gamesentenceminer-2.4.4.dist-info/entry_points.txt,sha256=2APEP25DbfjSxGeHtwBstMH8mulVhLkqF_b9bqzU6vQ,65
25
+ gamesentenceminer-2.4.4.dist-info/top_level.txt,sha256=V1hUY6xVSyUEohb0uDoN4UIE6rUZ_JYx8yMyPGX4PgQ,18
26
+ gamesentenceminer-2.4.4.dist-info/RECORD,,