+ if self.persist != PersistMethod.none:
+ window = deque(maxlen=PERSISTENCE_RADIUS)
+
+ if self.persist == PersistMethod.sequence:
+ state = mwpersistence.DiffState(SequenceMatcher(tokenizer = wikitext_split),
+ revert_radius=PERSISTENCE_RADIUS)
+
+ elif self.persist == PersistMethod.segment:
+ state = mwpersistence.DiffState(SegmentMatcher(tokenizer = wikitext_split),
+ revert_radius=PERSISTENCE_RADIUS)
+
+ # self.persist == PersistMethod.legacy
+ else:
+ from mw.lib import persistence
+ state = persistence.State()
+
+
+