Skip to content

Commit 8b43a97

Browse files
authored
Merge pull request #263 from neoyxm/main
Update reformat.py, fix the memory leaking if running backend as server mode
2 parents 4163f5f + 46a5cb2 commit 8b43a97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/tools/reformat.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111

1212
import pysrt
13-
import wordsegment
13+
import wordsegment as ws
1414
import re
1515

1616

@@ -19,6 +19,7 @@ def execute(path, lang='en'):
1919
if sys.getrecursionlimit() < 100000:
2020
sys.setrecursionlimit(100000)
2121

22+
wordsegment = ws.Segmenter()
2223
wordsegment.load()
2324
subs = pysrt.open(path)
2425
verb_forms = ["I'm", "you're", "he's", "she's", "we're", "it's", "isn't", "aren't", "they're", "there's", "wasn't",

0 commit comments

Comments
 (0)