Hello,
it seems you didn't consider this last patch any further.
It was improving a lot on the speed of searching, thus it
seemed to me a reasonable way to improve usability of it.
I see some commits on trunk about FindAndReplace, are
you making a re-design of the feature ?
Bye,
T.
Tommaso Cucinotta ha scritto:
Hello,
please, find attached a preliminary patch implementing the idea.
Now, each paragraph that does not contain any match is only stringified
once, then we switch to the next one. When a matching paragraph
is found, it is searched for more carefully by going pos by pos.
Improvement w.r.t. the old unconditional pos-by-pos search is significant
(search in the math manual completes in a few seconds with debug
enabled).
Forward search seems ok, backward search has problems, but I'd like to
collect preliminary comments about the approach.
Also, I had to add a ::stringify() method in Paragraph, that mimics
the old
behaviour of the Paragraph::asString(), as now the latter method seems
to have been switched to a ToC-oriented usage.
Bye,
T.
Tommaso Cucinotta ha scritto:
I think I can easily modify it so as to realise a hierarchically
sequential search
(not a real binary search). Instead of advancing one position,
exporting from
the current position to the end of paragraph, then searching for a
matching segment
*at the start*, I would try to advance one paragraph each time,
exporting the
entire paragraph, searching for any match *inside*, then, if a match
is found,
proceed recursively advancing one position at a time searching for
the exact
position that has the match at beginning.
I'll see if I can play a little bit tonight with the idea.
T.
Abdelrazak Younes ha scritto:
Yes that too ;-)
That's also why the binary search is the most practical choice...
Abdel.
--
Tommaso Cucinotta, Computer Engineering PhD, Researcher
ReTiS Lab, Scuola Superiore Sant'Anna, Pisa, Italy
Tel +39 050 882 024, Fax +39 050 882 003
http://feanor.sssup.it/~tommaso