configure pywikidiff2 cache limits.

This commit is contained in:
Nathan TeBlunthuis
2025-08-01 09:24:54 -07:00
parent 83c92d1a37
commit 54e996b910
2 changed files with 14 additions and 11 deletions

View File

@@ -330,15 +330,17 @@ class WikiDiffMatcher:
):
self.tokenizer = tokenizer or TOKENIZER
class Processor(DiffEngine.Processor):
def __init__(self, tokenizer=None):
self.tokenizer = tokenizer or TOKENIZER
self.last_tokens = []
self.previous_text = ""
self.differ = pywikidiff2.pywikidiff2(
numContextLines=1000000, moved_paragraph_detection_cutoff=200000
numContextLines=1000000,
moved_paragraph_detection_cutoff=200000,
words_cache_capacity=10000,
diff_cache_capacity=10000,
stats_cache_capacity=100000,
)
self.last_diff = None