all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Word  Completion by  Association
@ 2003-03-03 20:13 Artist
  2003-03-03 23:16 ` jean daniel browne
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Artist @ 2003-03-03 20:13 UTC (permalink / raw)


Hi I am looking for mechanism which allows me to complete the word
based on association.  Example: I have only 4 words : [artist],
[google], [emacs], [gnu]

then the 'representations'   r , o, m, u should be enough to complete
the above words respectively. Now lets say that we add the word
[glass] in my set. Then 'glass' can be represented by 'l' and if we
add the word [late] it could be represented by 'lt'. It's like
shorthand for emacs or 'auto abbreviation'.

The key is that emacs automatically defines the abbreviations and let
us know.

Is it already  possible?  difficult? possible at all?

Thanks,
artist.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-03 20:13 Word Completion by Association Artist
@ 2003-03-03 23:16 ` jean daniel browne
  2003-03-03 23:52 ` Unknown
  2003-03-10 20:09 ` Stefan Monnier
  2 siblings, 0 replies; 9+ messages in thread
From: jean daniel browne @ 2003-03-03 23:16 UTC (permalink / raw)



Excuse me sir, could you be more specific?, your post seems very
interesting but
infortunately I can not understand it. I elaborated different
theories to match the words to their representations but to no avail.

Thank you


On 3 Mar 2003, Artist wrote:

> Hi I am looking for mechanism which allows me to complete the word
> based on association.  Example: I have only 4 words : [artist],
> [google], [emacs], [gnu]
>
> then the 'representations'   r , o, m, u should be enough to complete
> the above words respectively. Now lets say that we add the word
> [glass] in my set. Then 'glass' can be represented by 'l' and if we
> add the word [late] it could be represented by 'lt'. It's like
> shorthand for emacs or 'auto abbreviation'.
>
> The key is that emacs automatically defines the abbreviations and let
> us know.
>
> Is it already  possible?  difficult? possible at all?
>
> Thanks,
> artist.
>

jd
44 sq. Mare Gaudry - appt.17
06 07 65 98 82

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-03 20:13 Word Completion by Association Artist
  2003-03-03 23:16 ` jean daniel browne
@ 2003-03-03 23:52 ` Unknown
  2003-03-04  2:36   ` Artist
  2003-03-10 20:09 ` Stefan Monnier
  2 siblings, 1 reply; 9+ messages in thread
From: Unknown @ 2003-03-03 23:52 UTC (permalink / raw)


Artist wrote:

> Hi I am looking for mechanism which allows me to complete the word
> based on association.  Example: I have only 4 words : [artist],
> [google], [emacs], [gnu]
> 
> then the 'representations'   r , o, m, u should be enough to complete
> the above words respectively. Now lets say that we add the word
> [glass] in my set. Then 'glass' can be represented by 'l' and if we
> add the word [late] it could be represented by 'lt'. It's like
> shorthand for emacs or 'auto abbreviation'.
> 
> The key is that emacs automatically defines the abbreviations and let
> us know.
> 
> Is it already  possible?  difficult? possible at all?

Your questions are nothing if not interesting. ;)

Have you given any thought as to how you would implement such a completion 
system.

Currently substring completion is possible and it does most of what you ask 
for.  See icomplete, mcomplete.

--
Le

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-03 23:52 ` Unknown
@ 2003-03-04  2:36   ` Artist
  2003-03-04  4:06     ` Unknown
  2003-03-04 18:51     ` Edward O'Connor
  0 siblings, 2 replies; 9+ messages in thread
From: Artist @ 2003-03-04  2:36 UTC (permalink / raw)


Le Wang <lewang(at@)yahoo.com> wrote in message news:<YUR8a.151574$Zr%.124748@news01.bloor.is.net.cable.rogers.com>...
> Artist wrote:
> 
> > Hi I am looking for mechanism which allows me to complete the word
> > based on association.  Example: I have only 4 words : [artist],
> > [google], [emacs], [gnu]
> > 
> > then the 'representations'   r , o, m, u should be enough to complete
> > the above words respectively. Now lets say that we add the word
> > [glass] in my set. Then 'glass' can be represented by 'l' and if we
> > add the word [late] it could be represented by 'lt'. It's like
> > shorthand for emacs or 'auto abbreviation'.
> > 
> > The key is that emacs automatically defines the abbreviations and let
> > us know.
> > 
> > Is it already  possible?  difficult? possible at all?
> 
> Your questions are nothing if not interesting. ;)
> 
> Have you given any thought as to how you would implement such a completion 
> system.
> 
> Currently substring completion is possible and it does most of what you ask 
> for.  See icomplete, mcomplete.

Hi,
  You may call this method: Auto Abbreviation in a buffer.
  When I type the text in buffer, it should automagically note each
word and figure out different combination of it, and make combination
index which when typed in buffer again should result in uniq word.

ex.. If I type:
---------- This is emacs
 It should create an index file in such a way that 
when I type 'T' or 'h'   and hit some completion command it should
complete with  'This'.

My word:  Completion Word
Ti        This
hi        This
ts        This
em        emacs
mc        emacs
is        is
go        go      
es        emacs


Thus I need to recall minimum letter of what I typed earlier. This is
much like iswitchb interface with the addition that you can type any
combination of letters, not necessarily sequentially.  When I add more
words, above table will change on fly or with some command

I dont' know about mcomplete, but icomplete mode is not enough for
this.

Hope that would clarify.

Artist

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-04  2:36   ` Artist
@ 2003-03-04  4:06     ` Unknown
  2003-03-04 18:51     ` Edward O'Connor
  1 sibling, 0 replies; 9+ messages in thread
From: Unknown @ 2003-03-04  4:06 UTC (permalink / raw)


Artist wrote:

> Le Wang <lewang(at@)yahoo.com> wrote in message
> news:<YUR8a.151574$Zr%.124748@news01.bloor.is.net.cable.rogers.com>...
>> Artist wrote:
>> 
>> > Hi I am looking for mechanism which allows me to complete the word
>> > based on association.  Example: I have only 4 words : [artist],
>> > [google], [emacs], [gnu]
>> > 
>> > then the 'representations'   r , o, m, u should be enough to complete
>> > the above words respectively. Now lets say that we add the word
>> > [glass] in my set. Then 'glass' can be represented by 'l' and if we
>> > add the word [late] it could be represented by 'lt'. It's like
>> > shorthand for emacs or 'auto abbreviation'.
>> > 
>> > The key is that emacs automatically defines the abbreviations and let
>> > us know.
>> > 
>> > Is it already  possible?  difficult? possible at all?
>> 
>> Your questions are nothing if not interesting. ;)
>> 
>> Have you given any thought as to how you would implement such a completion
>> system.
>> 
>> Currently substring completion is possible and it does most of what you ask
>> for.  See icomplete, mcomplete.
> 
> Hi,
>   You may call this method: Auto Abbreviation in a buffer.
>   When I type the text in buffer, it should automagically note each
> word and figure out different combination of it, and make combination
> index which when typed in buffer again should result in uniq word.
> 
> ex.. If I type:
> ---------- This is emacs
>  It should create an index file in such a way that
> when I type 'T' or 'h'   and hit some completion command it should
> complete with  'This'.
> 
> My word:  Completion Word
> Ti        This
> hi        This
> ts        This
> em        emacs
> mc        emacs
> is        is
> go        go
> es        emacs
> 
> 
> Thus I need to recall minimum letter of what I typed earlier. This is
> much like iswitchb interface with the addition that you can type any
> combination of letters, not necessarily sequentially.  When I add more
> words, above table will change on fly or with some command
> 
> I dont' know about mcomplete, but icomplete mode is not enough for
> this.

mcomplete does substring completion for minibuffer input.

I see that you want substring completing for buffer content.  I'm pretty 
certain this does not exist right now.  Maybe you can make it as a 
hippie-expand method.

--
Le

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-04  2:36   ` Artist
  2003-03-04  4:06     ` Unknown
@ 2003-03-04 18:51     ` Edward O'Connor
  2003-03-05 14:42       ` Artist
  1 sibling, 1 reply; 9+ messages in thread
From: Edward O'Connor @ 2003-03-04 18:51 UTC (permalink / raw)


> Hi, You may call this method: Auto Abbreviation in a buffer.
> When I type the text in buffer, it should automagically note
> each word and figure out different combination of it, and make
> combination index which when typed in buffer again should result
> in uniq word.

Maybe dabbrev-expand, bound to M-/ by default, does something of
what you would like? Examples:

When I type this, I get that
da M-/            dabbrev-expand
Ab M-/            Abbreviation
di M-/            different


Ted

-- 
Edward O'Connor
oconnor@soe.ucsd.edu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-04 18:51     ` Edward O'Connor
@ 2003-03-05 14:42       ` Artist
  2003-03-06 15:39         ` Bijan Soleymani
  0 siblings, 1 reply; 9+ messages in thread
From: Artist @ 2003-03-05 14:42 UTC (permalink / raw)


Edward O'Connor <oconnor@soe.ucsd.edu> wrote in message news:<ddr89nj77o.fsf@oecpc11.ucsd.edu>...
> > Hi, You may call this method: Auto Abbreviation in a buffer.
> > When I type the text in buffer, it should automagically note
> > each word and figure out different combination of it, and make
> > combination index which when typed in buffer again should result
> > in uniq word.
> 
> Maybe dabbrev-expand, bound to M-/ by default, does something of
> what you would like? Examples:
> 
> When I type this, I get that
> da M-/            dabbrev-expand
> Ab M-/            Abbreviation
> di M-/            different
> 
> 
> Ted

I am well aware of this and it works fine for the string beginning.
I am looking for any characters in the string.

ex.. dfr SomeCommand =>  different
     dfn SomeCommand =>  different
     drnt SomeCommand => different
     vrb SomeCommand =>  abbreviation
     vxpd SomeCommand => dabbrev-expand
      

Thus the idea is provide multiple reference points for a string and
strings should be from limited scopes.

How difficult is to develop something like this? Any hints would be
useful.

Thanks,
[artist]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-05 14:42       ` Artist
@ 2003-03-06 15:39         ` Bijan Soleymani
  0 siblings, 0 replies; 9+ messages in thread
From: Bijan Soleymani @ 2003-03-06 15:39 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Word  Completion by  Association
  2003-03-03 20:13 Word Completion by Association Artist
  2003-03-03 23:16 ` jean daniel browne
  2003-03-03 23:52 ` Unknown
@ 2003-03-10 20:09 ` Stefan Monnier
  2 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2003-03-10 20:09 UTC (permalink / raw)


>>>>> "Artist" == Artist  <googleartist@yahoo.com> writes:
> Hi I am looking for mechanism which allows me to complete the word
> based on association.  Example: I have only 4 words : [artist],
> [google], [emacs], [gnu]

How about the following quick hack for a start ?
It changes the behavior of dabbrev along the lines of what you're
asking.  Obviously, we'd want this without losing the old behavior,
but that's for "future work".


        Stefan


--- dabbrev.el.~1.67.~	Wed Feb  5 10:54:43 2003
+++ dabbrev.el	Mon Mar 10 15:07:04 2003
@@ -972,10 +969,12 @@
 Returns the expansion found, or nil if not found.
 Leaves point at the location of the start of the expansion."
   (save-match-data
-    (let ((pattern1 (concat (regexp-quote abbrev)
-			    "\\(" dabbrev--abbrev-char-regexp "\\)"))
-	  (pattern2 (concat (regexp-quote abbrev)
-			   "\\(\\(" dabbrev--abbrev-char-regexp "\\)+\\)"))
+    (let ((pattern1 (concat (mapconcat (lambda (c) (regexp-quote (string c)))
+				       abbrev (concat "\\(?:" dabbrev--abbrev-char-regexp "\\)*"))
+			    "\\(?:" dabbrev--abbrev-char-regexp "\\)"))
+	  (pattern2 (concat (mapconcat (lambda (c) (regexp-quote (string c)))
+				       abbrev (concat "\\(?:" dabbrev--abbrev-char-regexp "\\)*"))
+			    "\\(\\(?:" dabbrev--abbrev-char-regexp "\\)+\\)"))
 	  ;; This makes it possible to find matches in minibuffer prompts
 	  ;; even when they are "inviolable".
 	  (inhibit-point-motion-hooks t)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-03-10 20:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-03 20:13 Word Completion by Association Artist
2003-03-03 23:16 ` jean daniel browne
2003-03-03 23:52 ` Unknown
2003-03-04  2:36   ` Artist
2003-03-04  4:06     ` Unknown
2003-03-04 18:51     ` Edward O'Connor
2003-03-05 14:42       ` Artist
2003-03-06 15:39         ` Bijan Soleymani
2003-03-10 20:09 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.