mirror of https://github.com/python/cpython
80a2a4ed7d
- Make case-swaps half the cost of any other edit - Refactor Levenshtein code to not use memory allocator, and to bail early on no match. - Add comments to Levenshtein distance code - Add test cases for Levenshtein distance behind a debug macro - Set threshold to `(name_size + item_size + 3) * MOVE_COST / 6`. - Reasoning: similar to `difflib.SequenceMatcher.ratio()` >= 2/3: ``` "Multiset Jaccard similarity" >= 2/3 matching letters / total letters >= 2/3 (name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3 1 - (2*distance) / (name_size + item_size) >= 2/3 1/3 >= (2*distance) / (name_size + item_size) (name_size + item_size) / 6 >= distance With rounding: (name_size + item_size + 3) // 6 >= distance ``` Co-authored-by: Pablo Galindo <pablogsal@gmail.com> |
||
---|---|---|
.. | ||
clinic | ||
Python-ast.c | ||
README | ||
_warnings.c | ||
asdl.c | ||
ast.c | ||
ast_opt.c | ||
ast_unparse.c | ||
bltinmodule.c | ||
bootstrap_hash.c | ||
ceval.c | ||
ceval_gil.h | ||
codecs.c | ||
compile.c | ||
condvar.h | ||
context.c | ||
dtoa.c | ||
dup2.c | ||
dynamic_annotations.c | ||
dynload_hpux.c | ||
dynload_shlib.c | ||
dynload_stub.c | ||
dynload_win.c | ||
errors.c | ||
fileutils.c | ||
formatter_unicode.c | ||
frozen.c | ||
frozen_hello.h | ||
frozenmain.c | ||
future.c | ||
getargs.c | ||
getcompiler.c | ||
getcopyright.c | ||
getopt.c | ||
getplatform.c | ||
getversion.c | ||
hamt.c | ||
hashtable.c | ||
import.c | ||
importdl.c | ||
importdl.h | ||
importlib.h | ||
importlib_external.h | ||
importlib_zipimport.h | ||
initconfig.c | ||
makeopcodetargets.py | ||
marshal.c | ||
modsupport.c | ||
mysnprintf.c | ||
mystrtoul.c | ||
opcode_targets.h | ||
pathconfig.c | ||
preconfig.c | ||
pyarena.c | ||
pyctype.c | ||
pyfpe.c | ||
pyhash.c | ||
pylifecycle.c | ||
pymath.c | ||
pystate.c | ||
pystrcmp.c | ||
pystrhex.c | ||
pystrtod.c | ||
pythonrun.c | ||
pytime.c | ||
stdlib_module_names.h | ||
structmember.c | ||
suggestions.c | ||
symtable.c | ||
sysmodule.c | ||
thread.c | ||
thread_nt.h | ||
thread_pthread.h | ||
traceback.c | ||
wordcode_helpers.h |
README
Miscellaneous source files for the main Python shared library