From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bijan Soleymani Newsgroups: gmane.emacs.help Subject: Re: Word Completion by Association Date: 06 Mar 2003 10:39:37 -0500 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87heagsdvq.fsf@server.crasseux.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1046964974 28749 80.91.224.249 (6 Mar 2003 15:36:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2003 15:36:14 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 06 16:36:12 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18qxPc-0007SU-00 for ; Thu, 06 Mar 2003 16:36:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qxOy-0007U2-04 for gnu-help-gnu-emacs@m.gmane.org; Thu, 06 Mar 2003 10:35:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!wesley.videotron.net!weber.videotron.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-NNTP-Posting-Host: 24.201.123.149 Original-X-Complaints-To: abuse@videotron.ca Original-X-Trace: weber.videotron.net 1046964734 24.201.123.149 (Thu, 06 Mar 2003 10:32:14 EST) Original-NNTP-Posting-Date: Thu, 06 Mar 2003 10:32:14 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:110882 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7383 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7383 googleartist@yahoo.com (Artist) writes: > How difficult is to develop something like this? Any hints would be > useful. It all depends on how efficient you want it to be. The worst way to do it is to keep a list of all words, and scan through the entire list for each key enterred :) A better way is to determine what letters are in each word in your list. Then store the list of words with each letter. have a list for words with a, another for words with b, etc. so "hello" would be in the 'e','h','l' and 'o' lists (maybe have a list for multiple occurences of letters 'l' x 2) Then for a particular input, for example "fmt", check for words that are in the 'f', 'm' and 't' lists, and use the first one. This is still not very efficient, but it is very easy to do. Bijan