use wikidiff2 with lru cache.
This commit is contained in:
		
							parent
							
								
									d831b7626b
								
							
						
					
					
						commit
						6ef2a769d5
					
				| @ -1 +1 @@ | ||||
| Subproject commit 8639762681cb05aabb644743fee715fabe1263d4 | ||||
| Subproject commit a9547bcef9f84bd87f7d627c41ec5dae95365e6b | ||||
| @ -34,6 +34,9 @@ pywikidiff2_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | ||||
|     self->config.maxSplitSize = 1; | ||||
|     self->config.initialSplitThreshold = 0.1; | ||||
|     self->config.finalSplitThreshold = 0.6; | ||||
|     self->config.wordsCacheCapacity = 10000; | ||||
|     self->config.diffCacheCapacity = 10000; | ||||
|     self->config.statsCacheCapacity = 100000; | ||||
|     return (PyObject *) self; | ||||
| } | ||||
| 
 | ||||
| @ -41,7 +44,7 @@ static int | ||||
| pywikidiff2_init(pywikidiff2Obj *self, PyObject *args, PyObject *kwds) | ||||
| { | ||||
|   // here's where we set non-default configuration values
 | ||||
|   static char *kwlist[] = {"numContextLines", "moved_line_threshold", "change_threshold", "moved_paragraph_detection_cutoff", "max_word_level_diff_complexity", "max_split_size", "initial_split_threshold", "final_split_threshold", NULL}; | ||||
|   static char *kwlist[] = {"numContextLines", "moved_line_threshold", "change_threshold", "moved_paragraph_detection_cutoff", "max_word_level_diff_complexity", "max_split_size", "initial_split_threshold", "final_split_threshold", "words_cache_capacity", "diff_cache_capacity", "stats_cache_capacity", NULL}; | ||||
|   if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iffiiiff", kwlist, | ||||
| 				   &self->config.numContextLines, | ||||
| 				   &self->config.movedLineThreshold, | ||||
| @ -50,7 +53,10 @@ pywikidiff2_init(pywikidiff2Obj *self, PyObject *args, PyObject *kwds) | ||||
| 				   &self->config.maxWordLevelDiffComplexity, | ||||
| 				   &self->config.maxSplitSize, | ||||
| 				   &self->config.initialSplitThreshold, | ||||
| 				   &self->config.finalSplitThreshold | ||||
| 				   &self->config.finalSplitThreshold, | ||||
| 				   &self->config.wordsCacheCapacity, | ||||
| 				   &self->config.diffCacheCapacity, | ||||
| 				   &self->config.statsCacheCapacity | ||||
| 				   )){ | ||||
|     PyErr_SetString(PyExc_ImportError,"Error in configuration"); | ||||
|     return -1; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user