[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dict-tree 63b59a2 135/154: Implement fuzzy-completion w
From: |
Stefan Monnier |
Subject: |
[elpa] externals/dict-tree 63b59a2 135/154: Implement fuzzy-completion with fixed initial prefix segment. |
Date: |
Mon, 14 Dec 2020 12:22:01 -0500 (EST) |
branch: externals/dict-tree
commit 63b59a2639c01ec3db9ef3ce569deb1231c5e341
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Implement fuzzy-completion with fixed initial prefix segment.
---
dict-tree.el | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/dict-tree.el b/dict-tree.el
index 0ce595c..4fc9912 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -2952,11 +2952,11 @@ of the default key-dist-data list."
&optional rank-function maxnum reverse filter resultfun no-cache)
"Return completion of prefixes in DICT within Lewenstein DISTANCE
\(edit distance\) of PREFIX along with their associated data, in
-the order defined by RANKFUN, defauling to \"lexicographic\"
-order. If REVERSE is non-nil, the matches are sorted in the
-reverse order. Returns nil if no completions are found.
+the order defined by RANKFUN, defauling to lexicographic order.
+If REVERSE is non-nil, the matches are sorted in the reverse
+order. Returns nil if no completions are found.
-Returns a list of completions, with elements of the form:
+Returns a list of completions with elements of the form:
((KEY DIST PFXLEN) . DATA)
@@ -2978,8 +2978,15 @@ DICT. If PREFIX is a string, it must be possible to apply
`string' to individual elements of DICT keys. The KEYs returned
in the list will be sequences of the same type as PREFIX.
-DISTANCE must be an integer, and specifies the maximum Lewenstein
-distance \(edit distances\) of prefixes from PREFIX.
+
+DISTANCE is a positive integer specifying the maximum Lewenstein
+distance prefixes from PREFIX. \(Note that DISTANCE=0 will not
+give meaningful results; use `trie-complete' instead.\)
+
+DISTANCE can also be a cons cell \(LENGTH . DISTANCE\) containing
+two positive integers. In this case, the first LENGTH elements of
+PREFIX must be matched exactly, and the remaining elements must
+be within the specified Lewenstain DISTANCE.
If optional argument RANK-FUNCTION is the symbol `ranked', the
@@ -3026,17 +3033,17 @@ of the result. Ignored for dictionaries that do not have
fuzzy-match caching enabled.
-The FILTER argument sets a filter function for the matches. If
-supplied, it is called for each possible match with two
-arguments: a (KEY DIST PFXLEN) list, and DATA. If the filter
-function returns nil, the match is not included in the results,
-and does not count towards MAXNUM.
+FILTER sets a filter function for the matches. If supplied, it is
+called for each possible match with two arguments: a
+\(KEY DIST PFXLEN\) list, and DATA. If FILTER returns nil, that
+match is not included in the results, and does not count towards
+MAXNUM.
RESULTFUN defines a function used to process results before
adding them to the final result list. If specified, it should
-accept two arguments: a (KEY DIST PFXLEN) list, and DATA. Its
+accept two arguments: a \(KEY DIST PFXLEN\) list, and DATA. Its
return value is what gets added to the final result list, instead
-of the default key-dist-data list."
+of the default key-dist-pfxlen-data list."
;; run fuzzy-complete query
(dictree--query
- [elpa] externals/dict-tree 5e2ffac 136/154: Test for lexical binding must be within same file to work reliably., (continued)
- [elpa] externals/dict-tree 5e2ffac 136/154: Test for lexical binding must be within same file to work reliably., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 22d0e13 140/154: Sort completions by fuzzy dist before ngram length., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 67afade 151/154: Document PFXFILTER argument to query functions., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 4299171 150/154: Work around Emacs bug preventing dict-tree caching., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 22d569e 153/154: Improve error reporting when reading dictionary data from dumped file., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree f0af36e 148/154: Fix byte-compilation of functions embedded in dict-trees., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree dd695da 147/154: Display more informative message during writing dict to file., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 45270bc 144/154: Cache all queries, not just those with named function arguments., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 1db3424 128/154: Fix quoting of ' in one docstring., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 77f7b3a 133/154: Minor code refactoring., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 63b59a2 135/154: Implement fuzzy-completion with fixed initial prefix segment.,
Stefan Monnier <=
- [elpa] externals/dict-tree 4381f72 114/154: Generate caches as needed instead of at dict-tree creation., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree ad600f8 116/154: Fix data wrapping handling in fuzzy query functions., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 8d134c2 110/154: Fix bug in dictree-create with empty NAME argument., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3c4b666 142/154: Refactored and rationalised dict saving/loading code., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree f232541 121/154: Merge updates to pretty-printy and docstring fixes from ELPA., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 97aba17 138/154: Fix bug introduced in dictree-member-p., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 8e99e74 145/154: Allow dictree-write to write dictionary under new name., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree f572523 146/154: Refactor dictree-populate-from-file., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3a99d02 118/154: Cache all queries, even with custom rankfun or filter., Stefan Monnier, 2020/12/14