Page 2 of 7

Re: Text Filter

Posted: 14 Jan 2021, 06:01
by rommmcek
New window or not doesn't matter. The difference is, that he takes for each subsequent step the result of a previous query as a new haystack, while I take always the original haystack.

Stepping forward, I believe results are the same as long "case sensitivity" and "whole word match" is for both the same (putting asside, that his approach is for each subsequent step a bit faster).

Stepping backwards I can now change "case sensitivity" and "whole word match" and so come to a dead end before coming to the first step (if I wouldn't take the original haystack). Besides I can go now directly to the first step or in-between moreover, I can branch from what ever step in-between to a new step direction, or start a completely new query...

P.s.: teadrinker's approach makes difference between needles e.g. a b and b a, besides it's slower and "attacks" the whole haystack at once which can make app unresponsive for a large haystack much earlier.

P.p.s.: Updated script on previous page (small not essential changes)

Re: Text Filter

Posted: 14 Jan 2021, 07:07
by garry
@rommmcek thank you for your comments and the excellent script , good idea from @SundayProgrammer

Re: Text Filter

Posted: 14 Jan 2021, 07:53
by SundayProgrammer
SpeedMaster wrote:
13 Jan 2021, 16:35
rommmcek wrote:
13 Jan 2021, 12:47
There is no multi level anymore! Now it's real time! Every change of the needle searches across the whole haystack!
by a "multi-level" search, I mean a step-by-step search like this :think:
.
.
.
SundayProgrammer has a different approach for each step/level there is a new window :roll:
even though i like the "real time" (aka Find As You Type) approach by @rommmcek, they are by all means not mutually exclusive whatsoever. we can always have both FAYT and multi-level in one single tool, i guess. i've already come up an idea how to arrange them in a design. and am squeezing time to work on it.

Re: Text Filter

Posted: 14 Jan 2021, 07:55
by rommmcek
Yeah, the main credit goes to SundayProgrammer's filter engine!
One more update on previous page to get the right output count!

Re: Text Filter

Posted: 14 Jan 2021, 08:06
by garry
@rommmcek I think the line count was correct if each line ends with `n ( also the last line )

Code: Select all

;.....
I took the one less traveled by,
And that has made all the difference.

)"
;...

Re: Text Filter

Posted: 14 Jan 2021, 08:11
by rommmcek
You're right, now I edited the script (twice!) so count will be always correct!
strreplace(RTrim(Haystack, "`r`n") "`n", "`n",, blc)

Re: Text Filter

Posted: 14 Jan 2021, 08:33
by garry
@rommmcek thank you , works fine , count lines with / or without `n at last text-line
A question for checkbox : both checked is possible ? So not radio-button needed ? ( "When the user clicks a radio button to turn it on, any others in its radio group are turned off automatically " )

Re: Text Filter

Posted: 14 Jan 2021, 09:10
by rommmcek
Case sensitive and Whole word only are independent. We can check only one of them, both or non as we desire, similar to Find options in most editors!

Re: Text Filter

Posted: 14 Jan 2021, 09:28
by ozzii
thank you @SundayProgrammer and @rommmcek

Re: Text Filter

Posted: 14 Jan 2021, 12:44
by rommmcek
Fixed bug for marking Case sensitive/insensitive search, introduced through changing its logic!

Re: Text Filter

Posted: 14 Jan 2021, 18:03
by kunkel321
Hey would it be difficult to set this up for use with larger texts? I tried pasting in the main section of the hotstrings from AutoCorrect.ahk
https://www.autohotkey.com/download/AutoCorrect.ahk
but I get an error that the continuation section is too long. I think it only sees the first 700 hotkeys or so.

Re: Text Filter

Posted: 14 Jan 2021, 20:43
by rommmcek
You most probably use first script in the OP. It is obsolete now! I recommend you to use this script.
Besides there is one more truble. Text in your link is in one line only and Text Filter is designed to work on multiple lines. To fix this append to the script (in the link) F8:: Clipboard:= StrReplace(Clipboard, "::", ";::`n") Run the script and press F8 to transform your one line text in the Clipboard to multiline text. Then you can paste into Text Filter Gui.

Re: Text Filter

Posted: 15 Jan 2021, 09:50
by sofista
Nice script, thank you. Maybe it's too much to ask for, but is there any chance to hightligth the matched strings?

Re: Text Filter

Posted: 15 Jan 2021, 09:58
by rommmcek
Focus haystack control via tab or mouse click and press f.

Re: Text Filter

Posted: 15 Jan 2021, 13:54
by sofista
Thank you for the fast reply. However, I was expecting something else. Will try to explain my point. From my Notepad++ experience to highlight a string is a different action from a selection, as the caret is not involved. Highlighting just colors all the matched strings without the need to select them -although it can do that, but I don't requiere it here-, since the main use I thought for highligthing is to visualize all the search results at a glance.

Hope this is still possible.

Re: Text Filter

Posted: 15 Jan 2021, 14:51
by rommmcek
I'm not an expert! But Notepad++ is using Scintilla control, This thread is using standard Windows Edit control. Your wish is like: Can MS Notepad color all matches? The Answer is no!
However e.g. AutoGUI uses Scintilla too and there it is possible. If Text Filter will ever implement Scintilla... I don't know, but you can start it by yourself and I'm sure you'll get some help form members...

Re: Text Filter

Posted: 15 Jan 2021, 16:45
by kunkel321
rommmcek wrote:
14 Jan 2021, 20:43
You most probably use first script in the OP. It is obsolete now! I recommend you to use this script.
Besides there is one more truble. Text in your link is in one line only and Text Filter is designed to work on multiple lines. To fix this append to the script (in the link) F8:: Clipboard:= StrReplace(Clipboard, "::", ";::`n") Run the script and press F8 to transform your one line text in the Clipboard to multiline text. Then you can paste into Text Filter Gui.
Thanks for the feedback Rommmcek! Sorry for my not asking a clear question... It wasn't the entire AutoCorrect.ahk script that I was using, just the part that looks like:
Spoiler
Also, though, the thing that I was really interested in is whether the script could be adapted to larger sources of text. Right now it seems to be using a continuation section that is hardcoded into the script. There's no reason you couldn't have a 50 page document (that is separated into separate lines) and save it to a variable, then load that variable into Text Filter, yes?

EDIT: I thought it might be as easy as substituring the below code for that hard-coded poem, but alas, this does not work.

Code: Select all

theHay:= theHaystack:= %ClipboardAll%

Re: Text Filter

Posted: 15 Jan 2021, 17:04
by rommmcek
I've been using it on a 23M wordlist (700k+ lines) without problem. Don't use first script on page one!

Re: Text Filter

Posted: 15 Jan 2021, 17:09
by kunkel321
Yep, I was using the revised version. Just had my syntax wrong...
This works:

Code: Select all

theHay:= theHaystack:= Clipboard
I just tried it with chapter 392-172 of the Washington Administrative Codes (WAC). 131 pages. It was super fast -- awesome!

EDIT: As a side note: This words well for legal documents, because they are already formatted into an outline format anyway (bullets and numbered lists).

Re: Text Filter

Posted: 15 Jan 2021, 17:47
by sofista
rommmcek wrote:
15 Jan 2021, 14:51

However e.g. AutoGUI uses Scintilla too and there it is possible. If Text Filter will ever implement Scintilla... I don't know, but you can start it by yourself and I'm sure you'll get some help form members...
Hmm, for the time being I have had enough of Scintilla. Dealing with Notepad++ Scintilla component was for me a frustrating and unproductive experience, so I'm quite reluctant to get involved again with it. At least, not without new ideas, which I currently lack. Time will tell :roll: