Yes, I'm happy with the 2 parallel versions A and B. I'd use the B version in preference.
It's been very hot in London as well but we're now in the middle of a very violent, and impressive, thunderstorm.
Dave.
logical NOT operator
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
I'm making good progress. Here's the new, and probably final, state of the TrackerV3 Boolean file search syntax.
Code: Select all
Boolean Operators in TrackerV3
OR: |, or, OR (must have a space on both ends)
AND: &, and, AND (must have a space on both ends)
NOT: ! (no spaces)
Operator precedence
NOT > AND > OR
Examples
Search Syntax Alternative Syntax Boolean Equivalent
cat "cat"
!cat NOT "cat"
cat & dog cat and dog "cat" AND "dog"
cat & !dog cat and !dog "cat" AND (NOT "dog")
!cat & !dog !cat and !dog (NOT "cat") AND (NOT "dog")
= NOT ("cat" OR "dog")
cat | dog cat or dog "cat" OR "dog"
pig | cat & dog pig or cat and dog "pig" OR ("cat" AND "dog")
pig | cat & !dog pig or cat and !dog "pig" OR ("cat" AND (NOT "dog"))
!pig | cat & dog !pig or cat and dog (NOT "pig") OR ("cat" AND "dog")
Escape character is \
\!cat "!cat"
!\!cat NOT "!cat"
cat \& dog "cat & dog"
cat \and dog "cat and dog"
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
'Tis a bit cooler today, so I took a chance on the NOT implementation, and here it is!Gandolf wrote:It's been very hot in London as well but we're now in the middle of a very violent, and impressive, thunderstorm.
I tested thoroughly, and you should, too! Syntax works as stated in my last posting.
Donald
Should there be a link to the download?
Not sure I like the "!" without a space. The space makes it stand out better from the text, but I'll see how it goes.
I agree about not using the ";" - too many options for the same thing can lead to confusion.
Having seen in the History.txt file
! fixed minor bug
!!! fixed major bug
Does that mean NOT fixed minor bug and NOT NOT NOT fixed major bug.
Dave.
Not sure I like the "!" without a space. The space makes it stand out better from the text, but I'll see how it goes.
I agree about not using the ";" - too many options for the same thing can lead to confusion.
Having seen in the History.txt file
! fixed minor bug
!!! fixed major bug
Does that mean NOT fixed minor bug and NOT NOT NOT fixed major bug.
Dave.
Thank you for NOT-operator implementing, but I think parentheses-based syntax would be much more flexible and clear for any user at the same time:So, AND precedes OR by default (and there's no way to overwrite the default because I do not want to introduce parentheses - it would just be too much).
((m* | aa*) & (!*.jpg)) & bb*
And if you decided to use exclamation sign without space (very good decision!), woud it possible to exlude spaces from "&" and "|" syntax? I think the whole syntax must be uniform...
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Well, I think parentheses-based syntax would be an overkill for the majority of users (and quite tricky to implement). Your example shows that clarity is not automatically achieved with parentheses (you probably did not concentrate too hard while typing it ):Leopoldus wrote:... I think parentheses-based syntax would be much more flexible and clear for any user at the same time:
((m* | aa*) & (!*.jpg)) & bb*
(a) it has two superfluous parentheses and should read: (m* | aa*) & (!*.jpg) & bb*
(b) it will not find a single file on any system (do you see why?)
I find it harder to read without the spaces. Did you try it?Leopoldus wrote:And if you decided to use exclamation sign without space (very good decision!), woud it possible to exlude spaces from "&" and "|" syntax? I think the whole syntax must be uniform...
No, I did not at all. It was not my aid to create really working sample of inquire, but only to iilustrate my thought grafically. OK, you are right, it seems to be not a very good sample But a bad implement must not destroy the conception itself.you probably did not concentrate too hard
Yes, it is harder to read, but exactly three time more comfortable and quicker to input.I find it harder to read without the spaces. Did you try it?
And it is not so much harder to read as well:
aa&bb|cc&!dd
aa & bb | cc & !dd
There is another solution too. You coud make the app to ingnore all spaces in inquire:
aa & bb | cc & !dd = aa&bb|cc&!dd
In this case any user can choose oneself if reading or writing is more important for him.
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Hmm, hard enough.Leopoldus wrote:And it is not so much harder to read as well:
aa&bb|cc&!dd
aa & bb | cc & !dd
But what if you're looking for spaces in the filename? Ignoring all spaces would sabotage that. And, as it is now, you can look for a file called "a&b.txt" without using escapes. With your system you would have to write "a\&b.txt".Leopoldus wrote:There is another solution too. You coud make the app to ingnore all spaces in inquire:
aa & bb | cc & !dd = aa&bb|cc&!dd
In this case any user can choose oneself if reading or writing is more important for him.
I'd like to hear other voices, please.
Donald
Well, filenames may content spaces and service symbols (as "&"), but I suppose nobody never really includes neither spaces nor special symbols in search inquire, but only letters (and may be figures sometimes).But what if you're looking for spaces in the filename? Ignoring all spaces would sabotage that. And, as it is now, you can look for a file called "a&b.txt" without using escapes. With your system you would have to write "a\&b.txt".
Let others tell am I right or not.
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
I really don't see what's so hard about typing some spaces. We do it all the time, almost unconsciously, and for good reason it's the biggest key on the keyboard. Actually, to me (and to many others, I guess) it feels natural to separate terms by spaces. I would have to force myself NOT to do it.
The NOT-operator is different, it's like a semantic prefix: sure vs unsure. It (dis)qualifies the term it is prefixed to.
The NOT-operator is different, it's like a semantic prefix: sure vs unsure. It (dis)qualifies the term it is prefixed to.