On Sat, 12 Feb 2011 11:47:40 -0600 "Roland Winkler" <wink...@gnu.org> wrote:
RW> So I would suggest the following "BBDB task sheet" for a generic RW> completion algorithm that could possibly replace the current code in RW> bbdb-complete-mail: RW> (1) Substring completion needs to have some understanding of the RW> text that is completed so that completion starting points within RW> the full strings are meaningful: RW> - typing `ler' should complete `john leremy <l...@bar.com>' RW> or `<johnler...@bar.com>' (or even `<johnler...@bar.com>'), RW> but not `Joe Miller <j...@bar.com>' RW> - typing `com' should only complete to your buddy's name RW> `John Combs <co...@bar.org>' but never j...@bar.com RW> ...you can easily figure out more such examples. I would approach this as a scoring problem. Let BBDB have a score for each address (so multiples can be in a record), defaulting to 0. Then: - exact matches (matching the beginning-of-word boundary) get +10000 - case-sensitive substring matches get +5000 - case-insensitive substring matches get +2000 - substring on the name gets 100, substring on the address gets +50 - each completion to an address does (incf address-score 10) in BBDB - user can edit the record's scores directly And so on, but the important thing is to have scoring rules and base scores. The user should be able to customize both. Then just order the candidates by score. RW> (2) The algorithm needs to recognize which lexicographically RW> unrelated mail addresses belong to one record so that cycling RW> can be based on these entries only: IMO the cycling should only be based on scores. That would, I think, accomplish all your items and produce less "DWIM but that's not it." Ted ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ bbdb-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/