diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-27 02:13:05 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-27 02:13:05 -0700 |
commit | eb57bf69db2ceddb02143bc49ed07e60262cc4f5 (patch) | |
tree | 19761031667581d27b2c9eb112e862db24175f50 /luaotfload-database.lua | |
parent | 10b824a46452e3a7aae5cdffb4d86af353e443e7 (diff) | |
parent | 402a0e45f1a562459baee83c724689fed17276fd (diff) | |
download | luaotfload-eb57bf69db2ceddb02143bc49ed07e60262cc4f5.tar.gz |
Merge pull request #128 from phi-gamma/master
AFM changes
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r-- | luaotfload-database.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 9bf6823..755ad52 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -1112,20 +1112,20 @@ find_closest = function (name, limit) local cnames = current.sanitized --[[ This is simplistic but surpisingly fast. - Matching is performed against the “family” name - of a db record. We then store its “fullname” at - it edit distance. + Matching is performed against the “fullname” field + of a db record in preprocessed form. We then store the + raw “fullname” at its edit distance. We should probably do some weighting over all the font name categories as well as whatever agrep does. --]] if cnames then - local fullname, family = cnames.fullname, cnames.family + local fullname, sfullname = current.fullname, cnames.fullname - local dist = cached[family]--- maybe already calculated + local dist = cached[sfullname]--- maybe already calculated if not dist then - dist = iterative_levenshtein(name, family) - cached[family] = dist + dist = iterative_levenshtein(name, sfullname) + cached[sfullname] = dist end local namelst = by_distance[dist] if not namelst then --- first entry |