From 2efc87a7180ec6e92127d22d1a3eb8c44fd392db Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 8 Nov 2022 00:09:59 -0800 Subject: Update fonts English, Japanese, Chinese, and Korean should look much better now. French, German, and Spanish look like shit now, because I haven't figured out how to best make Noto Sans stay within its bounding box. * Use Noto Sans for most things * Simplify how we enable unicode blocks & assign fonts to them * Increase string matching window to 300. Works better in real-world test. --- string_matcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string_matcher.py') diff --git a/string_matcher.py b/string_matcher.py index 9060b26..f3284e9 100644 --- a/string_matcher.py +++ b/string_matcher.py @@ -66,7 +66,7 @@ def matchStrings(old_text: str, new_text: str, window_size = 3) -> str: # slice in the old and new transcriptions (O(N^2) time complexity). # This is still wildly inefficient, but good enough for continuous # transcription in a game bound by a single CPU core, like VRChat. - max_old_slices = 50 + max_old_slices = 300 old_n_slices = min(max_old_slices, len(old_text)) last_old_window = len(old_text) - window_size first_old_window = max(last_old_window - old_n_slices, 0) @@ -136,7 +136,7 @@ if __name__ == "__main__": good_out = "This repository contains the code for" assert(matchStrings(in1, in2) == good_out) - in1 = "a" * 10 * 1000 + in1 = "a" * 1000 in2 = "b" * 10 * 1000 # This should be fast (< 1 second) matchStrings(in1, in2) -- cgit v1.2.3