;ELC   
;;; Compiled by tom@tom-nix on Tue Jun 22 23:50:10 2010
;;; from file /home/tom/Desktop/auto-complete-1.3/fuzzy.el
;;; in Emacs version 23.1.50.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`fuzzy.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\207" [require regexp-opt custom-declare-group fuzzy nil "Fuzzy matching utilities." :group convenience :prefix "fuzzy-"] 8)
#@18 Error threshold.
(custom-declare-variable 'fuzzy-accept-error-rate '0.1 '(#$ . 763) :group 'fuzzy)
(byte-code "\301B\302\301!\204 \303\301\304\"\210\305B\302\305!\204! \303\305\306\307	\"\"\210\301\207" [current-load-list fuzzy-accept-length-difference default-boundp set-default 2 fuzzy-regexp-some-char format "\\w\\{0,%s\\}"] 5)
(defalias 'fuzzy-reverse-string #[(string) "\301\300\302\303\"\237\"\207" [string apply append nil] 5])
(defalias 'fuzzy-regexp-compile #[(string) "\306\211\211\307\310\311\312\313\fG\306\314W\203> \301J!\203, \302J!\202. PT\211\202 ,\315\313\fG\306\314W\203u \300J!\203c \302J!\202e PT\211\202O ,\316\260+\207" [#1=#:--cl---cl-var--25400-- #2=#:--cl---cl-var--25401-- #3=#:--cl---cl-var--25402-- i string #4=#:--cl-var-- nil #[(n) "\302\303\304	S]G	\305\\^O\306\"!\207" [string n regexp-opt-charset append 0 2 nil] 7] #[(n) "\301\302\"\303=\207" [n logand 1 0] 3] #[(n) "\301\302\"\302=\207" [n logand 1] 3] "\\(" 0 "" "\\|" "\\)" c #5=#:--cl-var-- fuzzy-regexp-some-char #6=#:--cl-var-- #7=#:--cl-var--] 6])
(defalias 'fuzzy-edit-distance 'fuzzy-jaro-winkler-distance)
#@52 http://en.wikipedia.org/wiki/Jaro-Winkler_distance
(defalias 'fuzzy-jaro-winkler-distance #[(s1 s2) "G\nG\306	]\307\245S]\310\211\310\311\211\312\311\"\310	\311W\203\250 H\310\fZ]\f\\^\311\313 \311!W\203\233 \nH\314\"\203\216 H\204\216 BI\210T\311\211!\211 \202\217 \313\203\233 T\211\202U !-\210T\211\202. \237\310\"\311\211#$\"W\203\334 H\211#\203\323 #$B$T\211\202\273 $\237,,%\311&\311%:\203\"%@&:\203\"&@\314\"\204T%A%&A&\202\361 ,\310\315^'(\316)\311\n*\316+\311'W\203\204)T\211)(GW\203\204()H+T\211+*GW\203\204*+H\314\"\203\204TT\211\202?.\310=\203\220\317\202\264\320!\321	\245\245\307\245Z\245#\322\245\211,\323\324\306,Z#\\).\207" [s1 l1 s2 l2 r m 1 2 0 nil make-vector t char-equal 5 -1 0.0 float + 3 * 0.1 tr p cs1 cs2 seen i #1=#:--cl-var-- c1 j #2=#:--cl-var-- c2 #3=#:--cl-var-- #4=#:--cl-var-- #5=#:--cl-var-- c #6=#:--cl-var-- #7=#:--cl-var-- #8=#:--cl-var-- #9=#:--cl-var-- #10=#:--cl-vec-- #11=#:--cl-idx-- #12=#:--cl-vec-- #13=#:--cl-idx-- dj] 7 (#$ . 1940)])
(byte-compile 'fuzzy-jaro-winkler-distance)
(defalias 'fuzzy-match #[(s1 s2 &optional function) "\204 \305\306	G\nGZ!X\205 	\n\"\307\fZY\207" [function s1 s2 fuzzy-accept-length-difference fuzzy-accept-error-rate fuzzy-edit-distance abs 1] 3])
#@45 all-completions family with fuzzy matching.
(defalias 'fuzzy-all-completions #[(string collection) "G\n\306\211\306	:\2033 @\211\307\fG	\n\\^O\310\"\203, \f	B	A\211\202 	\237-\207" [string length collection #1=#:--cl-var-- str s nil 0 fuzzy-match #2=#:--cl-var-- fuzzy-accept-length-difference] 6 (#$ . 3389)])
(byte-code "\301B\302\301!\204 \303\301\304\"\210\305B\302\305!\204 \303\305\304\"\210\304\207" [current-load-list fuzzy-search-cache default-boundp set-default nil fuzzy-search-cache-string] 3)
(defalias 'fuzzy-search-cache-activate #[nil "\302 \303\211\207" [fuzzy-search-cache fuzzy-search-cache-string make-hash-table nil] 2])
(defalias 'fuzzy-search-cache-deactive #[nil "\302\211\211\207" [fuzzy-search-cache fuzzy-search-cache-string nil] 3])
(defalias 'fuzzy-search-edit-distance #[(s1 s2) "\203# 	\204 \n\202# 	\n\232\204 \n\305!\210\202# \306\"\2064 \307\n\"\2032 \310\f#\210\f)\207" [fuzzy-search-cache fuzzy-search-cache-string s1 s2 d clrhash gethash fuzzy-edit-distance puthash] 4])
(defalias 'fuzzy-search-match #[(s1 s2) "\302	\303#\207" [s1 s2 fuzzy-match fuzzy-search-edit-distance] 4])
(defalias 'fuzzy-search-forward #[(string &optional bound noerror count) "\304!\305\212\n\204+ \306	\307#\203+ \310\311\312!\"\203# \302 \211\202 \312\224Tb\210\202 )\n\2057 \313\n!\210\312\225b*\207" [string regexp match-data bound fuzzy-regexp-compile nil re-search-forward t fuzzy-search-match match-string 1 store-match-data] 5])
(defalias 'fuzzy-search-backward #[(string &optional bound noerror count) "\306!\307\211\307\212\n\204T \310	\311#\203T \312\224\312\225\313\307!\210eG\314_Z]b\210\315	\f\311#\203J \316\317\312!\"\203B \302 \202+ \312\224Tb\210\202+ \n\204 b\210\202 \n\203b \313\n!\210\312\224b\202e \313\307!-\207" [string regexp match-data begin end bound fuzzy-regexp-compile nil re-search-backward t 1 store-match-data 2 re-search-forward fuzzy-search-match match-string] 5])
(byte-code "\301B\302\301!\204 \303\301\304\"\210\305B\302\305!\204 \303\305\306\"\210\307B\302\307!\204- \303\307\310\"\210\311B\302\311!\204< \303\311\304\"\210\312B\302\312!\204K \303\312\313\"\210\304\207" [current-load-list fuzzy-isearch default-boundp set-default nil fuzzy-isearch-failed-count 0 fuzzy-isearch-enabled on-failed fuzzy-isearch-original-search-fun fuzzy-isearch-prefix "[FUZZY] "] 3)
(defalias 'fuzzy-isearch-activate #[nil "\302\303\304 \207" [fuzzy-isearch fuzzy-isearch-failed-count t 0 fuzzy-search-cache-activate] 1])
(defalias 'fuzzy-isearch-deactivate #[nil "\302\303\304 \207" [fuzzy-isearch fuzzy-isearch-failed-count nil 0 fuzzy-search-cache-deactive] 1])
(defalias 'fuzzy-isearch #[nil "\203\f 	\203\n \306\207\307\207\n\203 	\203 \310\207\311\207\204< \f\312=\204< \f\313=\203K \204K \203K T\211\314V\203K \204C \315 \210	\203I \316\207\317\207	\203Q \320\207\321\207" [isearch-word isearch-forward isearch-regexp fuzzy-isearch fuzzy-isearch-enabled isearch-success word-search-forward word-search-backward re-search-forward re-search-backward always on-failed 1 fuzzy-isearch-activate fuzzy-search-forward fuzzy-search-backward search-forward search-backward isearch-wrapped fuzzy-isearch-failed-count] 2])
(defalias 'fuzzy-isearch-end-hook #[nil "\300 \207" [fuzzy-isearch-deactivate] 1])
(defalias 'turn-on-fuzzy-isearch #[nil "\302\303\304\305\"\207" [isearch-search-fun-function fuzzy-isearch-original-search-fun fuzzy-isearch add-hook isearch-mode-end-hook fuzzy-isearch-end-hook] 3 nil nil])
(defalias 'turn-off-fuzzy-isearch #[nil "\302\303\304\"\207" [fuzzy-isearch-original-search-fun isearch-search-fun-function remove-hook isearch-mode-end-hook fuzzy-isearch-end-hook] 3 nil nil])
(byte-code "\300\301\302\303\304$\210\305\301\304\"\210\306\307!\207" [ad-add-advice isearch-message-prefix (fuzzy-isearch-message-prefix nil t (advice lambda nil (if fuzzy-isearch (setq ad-return-value (concat fuzzy-isearch-prefix ad-return-value)) ad-return-value))) after nil ad-activate provide fuzzy] 5)
