Wednesday, May 5, 2010

Re: Support for quickly classifying or annotating with labels from a hierarchy

On May 5, 2:59 pm, Tim wrote:
> ======[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.
> =====[end of my interpretation]======

Correct, except for the "whitespace-stripped period-separated line":
each line in "class.txt" should be a class label that should be
available
for completion. The period part (like cl4.1 in my original posting)
was
just an example. Christian used it to detect the hierarchy (I guess),
but as you can see in my previous post, one might wish to use the
number part only for encoding the hierarchy, not for making the
class labels longer and more artificial.
But: this is only a small technical detail.

> 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.

OK, but I fear that with a long list in data.txt (like 30000 lines),
the completion will be not direct enough.

> 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

OK, I will check this possibility. But for now, Christian's solution
works very well and allows to be optimized further, if needed.

Ciao
Sven

--
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

No comments: