[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/trie e505b47 039/111: Pass equality function constructe
From: |
Stefan Monnier |
Subject: |
[elpa] externals/trie e505b47 039/111: Pass equality function constructed from trie comparison function to tNFA functions |
Date: |
Mon, 14 Dec 2020 11:35:16 -0500 (EST) |
branch: externals/trie
commit e505b47b24dee30767bffc30ca26e7460e0aff31
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@dr-qubit.org>
Pass equality function constructed from trie comparison function to tNFA
functions
---
trie.el | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/trie.el b/trie.el
index 630a40f..05c462c 100644
--- a/trie.el
+++ b/trie.el
@@ -293,6 +293,14 @@
(t (,cmpfun a b)))))
+(defun trie--construct-equality-function (comparison-function)
+ ;; create equality function from trie comparison function
+ `(lambda (a b)
+ (and (not (,comparison-function a b))
+ (not (,comparison-function b a)))))
+
+
+
;;; ----------------------------------------------------------------
;;; Functions and macros for handling a trie node.
@@ -1589,7 +1597,8 @@ default key-data cons cell."
rankfun maxnum reverse filter resultfun accumulator nil
(trie--do-regexp-search
(trie--root trie)
- (tNFA-from-regexp regexp)
+ (tNFA-from-regexp regexp :test (trie--construct-equality-function
+ (trie--comparison-function trie)))
(cond ((stringp regexp) "") ((listp regexp) ()) (t []))
0 (or (and maxnum reverse) (and (not maxnum) (not reverse)))
(trie--comparison-function trie)
@@ -1695,7 +1704,11 @@ elements that matched the corresponding groups, in
order."
;; Construct store for regexp stack based on TRIE.
(let ((seq (cond ((stringp regexp) "") ((listp regexp) ()) (t [])))
store)
- (push (list seq (trie--root trie) (tNFA-from-regexp regexp) 0)
+ (push (list seq (trie--root trie)
+ (tNFA-from-regexp
+ regexp :test (trie--construct-equality-function
+ (trie--comparison-function trie)))
+ 0)
store)
(trie--regexp-stack-repopulate
store reverse
- [elpa] externals/trie 7bf9008 100/111: Implement fuzzy-completion with fixed initial prefix segment., (continued)
- [elpa] externals/trie 7bf9008 100/111: Implement fuzzy-completion with fixed initial prefix segment., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 3117b5b 076/111: Fix bugs in trie searches introduced by code cleanup., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 5909c59 083/111: Include prefix length information in fuzzy completion results., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 18dc856 084/111: Don't wrap rank and filter functions for regexp and fuzzy queries., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 633c8b1 089/111: Mention iterator generators in Commentary., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 1eb515f 078/111: Implement trie fuzzy match and completion stacks., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 3b7aa3c 082/111: Document that fuzzy queries with distance 0 won't work., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 53146c1 080/111: Implement fuzzy match and completion on dict-trees., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 81268ae 012/111: Added functions for pushing things onto dictree and trie stacks, Stefan Monnier, 2020/12/14
- [elpa] externals/trie a402c27 021/111: Implemented wildcard searches!, Stefan Monnier, 2020/12/14
- [elpa] externals/trie e505b47 039/111: Pass equality function constructed from trie comparison function to tNFA functions,
Stefan Monnier <=
- [elpa] externals/trie a35651b 029/111: Implemented grouping constructs in trie wildcards, Stefan Monnier, 2020/12/14
- [elpa] externals/trie a8615f7 052/111: Bug-fixes to edebug pretty-print functions., Stefan Monnier, 2020/12/14
- [elpa] externals/trie a1f9faa 044/111: Re-filled to 72 chars/line, for mailing to gnu-emacs-sources list, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 13bb42f 042/111: Updated docstrings for regexp-related functions and others., Stefan Monnier, 2020/12/14
- [elpa] externals/trie c7c9994 015/111: trie--createfun now passed corresponding sequence as an argument, Stefan Monnier, 2020/12/14
- [elpa] externals/trie da9ace9 051/111: More efficient implementations of replacements for CL 'position' function., Stefan Monnier, 2020/12/14
- [elpa] externals/trie 0d17008 037/111: Added nilflag argument to trie-stack functions, Stefan Monnier, 2020/12/14
- [elpa] externals/trie f930fe9 027/111: Documentation updates related to wildcard searches and predictive features that make use of them, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 46369a7 026/111: Added trie-wildcard-match function, Stefan Monnier, 2020/12/14
- [elpa] externals/trie 7823234 095/111: Fix bug in trie-fuzzy-complete that meant it didn't return minimum prefix distance in some cases., Stefan Monnier, 2020/12/14