Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortest unique string matching for command mode #29

Open
kisielk opened this issue May 31, 2014 · 6 comments
Open

Shortest unique string matching for command mode #29

kisielk opened this issue May 31, 2014 · 6 comments

Comments

@kisielk
Copy link
Owner

kisielk commented May 31, 2014

No description provided.

@yarbelk
Copy link

yarbelk commented Jun 8, 2014

I started looking into this (and had a hard drive failure: so I'm starting again). Part of this to me means redoing the command switch (mode/normal.go) as a map.

This allows us to separate out an interface for things like movements, etc, and do some more functional things on these sets

It also lets us configure the keybindings and do something like. and seperate out the keystroke into a structure. This lets us do interesting things with the key bindings to get robust shortest unique strings and composed commands.

http://en.wikipedia.org/wiki/De_Bruijn_graph

There are some older algos that are simple to implement (did some playing with them for some gene sequencing work) and would possibly give us a fast and robust method of composing commands in various modes.

@yarbelk
Copy link

yarbelk commented Jun 8, 2014

plus - the switch makes me twitch.

@yarbelk
Copy link

yarbelk commented Jun 8, 2014

Also, that algorithm is a joke. Huffman would probably work better/easier.

@kisielk
Copy link
Owner Author

kisielk commented Jun 8, 2014

Interesting, I hadn't heard of De Brujin Graphs, I'll have to read up on it.

I was thinking of using a radix tree as the data structure for commands, but this sounds interesting.

@yarbelk
Copy link

yarbelk commented Jul 1, 2014

radix tree or huffman encoding would be significantly more sane than De Brujin Graphs

@yarbelk
Copy link

yarbelk commented Jul 3, 2014

ack. started reading the ed source code... ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants