DWizard commited on
Commit
b2ca465
1 Parent(s): 7baae45

use spellchecker, delete old code

Browse files

Former-commit-id: f781a44d7bc1bcc34a94e70d61cd7a1a9c14ea3f

Files changed (2) hide show
  1. SRT.py +0 -24
  2. pipeline.py +1 -0
SRT.py CHANGED
@@ -264,17 +264,6 @@ class SRT_script():
264
  else:
265
  new_word = word
266
  ready_words[i] = new_word
267
- # if word[-2:] == ".\n":
268
- # if word[:-2].lower() in term_enzh_dict:
269
- # new_word = word.replace(word[:-2], term_enzh_dict.get(word[:-2].lower()))
270
- # ready_words[i] = new_word
271
- # else:
272
- # ready_words[i] = word
273
- # elif word.lower() in term_enzh_dict:
274
- # new_word = word.replace(word,term_enzh_dict.get(word.lower()))
275
- # ready_words[i] = new_word
276
- # else:
277
- # ready_words[i]= word
278
  seg.source_text = " ".join(ready_words)
279
  pass
280
 
@@ -298,19 +287,6 @@ class SRT_script():
298
  else:
299
  new_word = word
300
  ready_words[i] = new_word
301
- # if word[-2:] == ".\n":
302
- # real_word = word[:-2]
303
- # if not dict.check(real_word.lower()):
304
- # new_word = word.replace(word[:-2], term_spellDict.suggest(real_word.lower())[0])
305
- # ready_words[i] = new_word
306
- # elif word[-1:] in [".", "\n", ","]:
307
- # real_word = word[:-1]
308
- # if not dict.check(real_word.lower()):
309
- # new_word = word.replace(word[:-1], term_spellDict.suggest(real_word.lower())[0])
310
- # ready_words[i] = new_word
311
- # elif not dict.check(word.lower()):
312
- # new_word = word.replace(word,term_spellDict.suggest(word.lower())[0])
313
- # ready_words[i] = new_word
314
  seg.source_text = " ".join(ready_words)
315
  pass
316
 
 
264
  else:
265
  new_word = word
266
  ready_words[i] = new_word
 
 
 
 
 
 
 
 
 
 
 
267
  seg.source_text = " ".join(ready_words)
268
  pass
269
 
 
287
  else:
288
  new_word = word
289
  ready_words[i] = new_word
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  seg.source_text = " ".join(ready_words)
291
  pass
292
 
pipeline.py CHANGED
@@ -125,6 +125,7 @@ else:
125
 
126
  # srt preprocess
127
  srt.form_whole_sentence()
 
128
  srt.correct_with_force_term()
129
  srt.write_srt_file_src(srt_file_en)
130
  script_input = srt.get_source_only()
 
125
 
126
  # srt preprocess
127
  srt.form_whole_sentence()
128
+ srt.spell_check_term()
129
  srt.correct_with_force_term()
130
  srt.write_srt_file_src(srt_file_en)
131
  script_input = srt.get_source_only()