On 05/04/2010 03:49 AM, Sven Hartrumpf wrote:
I have a fixed classification comprising around 50 classes.
The classes are organized in a simple hierarchy (tree depth up
to 3 or 4). How can I efficiently classify lines in a file (or
to put it differently: annotate the objects represented in
each line)?

I've been following this thread and Christian's valiant efforts to suss out what you want. Let me see if I can describe what I *think* you want. If it's accurate, perhaps my clarification can help bring about a solution.


======[my understanding]=======
You have two files: one file (say "data.txt") containing lines you want to classify by appending some classification found in your second file (say "class.txt"). The contents of "class.txt" may or may not be indented to visually show the hierarchy, but all you really care about is that the whitespace-stripped period-separated line from "class.txt" is picked by the user and appended to the line in "data.txt"

You then want to be able to go through data.txt line-by-line and pick the classification from class.txt with minimal effort[*], appending that classification to the line in question.

[*] for some definition of "minimal effort", though I'd suggest regular completion or omni-completion
=====[end of my interpretation]======


Is that understanding correct? My first thought would be to simply ensure that all characters in your classification file are in your 'iskeyword' setting (from your description, this would involve adding the period-character to 'isk'). Then with both files open, you could just type the first few characters of the classification and then use control+P/control+N to select an appropriate match. Alternatively, you could write a more complex omni-completion function that would allow you to find any sub-portion of your classification. You can read about that at

  :help new-omni-completion


If my understanding is wrong, please let me know where I misunderstood; and if it's correct, let the list know so that they (particularly Christian who seems to be exerting exceptional effort to assist) can proffer their thoughts too.

-tim





--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to