logical NOT operator
logical NOT operator
Is there some plans concerning logical operator "NOT" using in search expression?
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: logical NOT operator
NOT really.
Miss it?
Miss it?
No, I'm not. Indeed I hate it But there are so many files at my computer...you seem to be a search logic enthusiast
Do you mean Explorer to be The Standard of Perfect Search Utility?Explorer file search can't do NOT, right?
I don't think it would be very difficult task.suggest a symbol/operator/syntax for NOT
E.g. dash "-" for "NOT" and double dash for the dash as a part of file/directory name, if somebody needs in such meaning (it's improbable).
By the way, there is alternative for logical operators signs. You could use their directly as words, ie OR, AND, NOT; or [OR], [AND], [NOT]. You see, some files and directories may contain those words and brackets as a part of name, but nobody includes they as a part of a filename in searhing query.
So, sample is:
(Proctor & && & Gamble) -tooth
This "one" is not me, surely. I realize how complex is this task. Wnen I've written "I don't think it would be very difficult task.", I had meaned my own task to suggest the sign for the logical operator, not your mission to implement logical operator into your program.It's not as easy to implement as one might think.
Thnak you and good luck!
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
I'm thinking about another revision of the search syntax because I don't like the & and | operators: too many keystrokes and not so well readable for non-programmers. What do you think of this reformed system:
Donald
Code: Select all
Search Syntax Boolean Equivalent
cat "cat"
-cat NOT "cat"
cat dog "cat" AND "dog"
cat -dog "cat" AND NOT "dog"
-cat -dog NOT "cat" AND NOT "dog"
cat or dog "cat" OR "dog"
pig or cat dog ("pig" OR "cat") AND "dog"
pig or cat -dog ("pig" OR "cat") AND NOT "dog"
Escape character: \
\-cat "-cat"
cat\ dog "cat dog"
cat \or dog "cat or dog"
etc.
These too? (I'd rather not... too confusing)
-pig or cat NOT (pig OR cat) ???
(NOT pig OR cat) ???
-pig or -cat NOT (pig OR NOT cat) ???
(NOT pig OR NOT cat) ???
I don't like the first option, too much like plain text. "cat or dog" to me indicates looking for a file named "cat or dog.ext". The "-cat" would certainly not work in my case since I highlight temporary files I want to stand out with "---" prefix (---filename.ext), it makes them very obvious in a file list.
Not sure about the second option, sort of Regular Expression syntax and may confuse people like me who use Regular Expressions as often as possible.
The third one is definitely confusing since it's a mixture of the "-" sign and the "or" logical operator.
I think whatever character you choose sooner or later somebody will use it in a filename. #AND, #OR, #NOT seem to be used frequently in some search engines but you sound as if you want to use an expression with as few characters as possible, so I expect you would consider them too long.
I prefer Regular Expressions but that requires learning their logic and you need to incorporate the entire set to be of any use. It is more confusing if only some of the Regular Expressions work (a text editor I looked at the other day had \t but not \n). It might also be too complicated for the general user.
I'm quite happy with " & " and " | " even though it caught me out after you'd changed it and I recalled an expression from the history with the ";" and then wondered why it couldn't find the files!!!
You could, of course, make it user configurable and that should be able to please everybody (except you, because of the extra code required).
Dave.
Not sure about the second option, sort of Regular Expression syntax and may confuse people like me who use Regular Expressions as often as possible.
The third one is definitely confusing since it's a mixture of the "-" sign and the "or" logical operator.
I think whatever character you choose sooner or later somebody will use it in a filename. #AND, #OR, #NOT seem to be used frequently in some search engines but you sound as if you want to use an expression with as few characters as possible, so I expect you would consider them too long.
I prefer Regular Expressions but that requires learning their logic and you need to incorporate the entire set to be of any use. It is more confusing if only some of the Regular Expressions work (a text editor I looked at the other day had \t but not \n). It might also be too complicated for the general user.
I'm quite happy with " & " and " | " even though it caught me out after you'd changed it and I recalled an expression from the history with the ";" and then wondered why it couldn't find the files!!!
You could, of course, make it user configurable and that should be able to please everybody (except you, because of the extra code required).
Dave.
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
I hear you. I'm convinced. I just come up with a new suggestion (incl. 2 alternative operator sets):
(I will not go for RegExp for the reasons you named already)
Donald
Code: Select all
Search Syntax A Search Syntax B Boolean Equivalent
cat cat "cat"
not cat ! cat NOT "cat"
cat and dog cat & dog "cat" AND "dog"
cat and not dog cat & ! dog "cat" AND NOT "dog"
not cat and not dog ! cat & ! dog NOT "cat" AND NOT "dog"
cat or dog cat | dog "cat" OR "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 NOT "dog"
not pig or cat and dog ! pig | cat & dog NOT ("pig" OR "cat") AND "dog"
Escape character: \
\! cat "! cat"
cat \and dog "cat and dog"
cat \& dog "cat & dog"
etc.
Donald
I like version B since the AND and OR operators remain the same, you are just adding the NOT operator. I don't think I've ever seen the " ! " used as a not operator - excellent idea. I assume they will require the spaces same as " | " and " & " do. Pity about Regular Expressions but I understand your reason.
Dave.
Dave.
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Which tells me you're not a programmer. ! is the standard NOT-operator in languages like C, C++, Java, JavaScript, PHP and more. All those languages also have & for AND and | for OR. So ! for NOT is a very obvious choice here, and not my own idea at allGandolf wrote:I don't think I've ever seen the " ! " used as a not operator - excellent idea.
My plan was to allow version A and version B at the same time, being friendly to more "verbal" thinkers.Gandolf wrote:I like version B...
An ex-programer. Control system software in the 1980's using Z80 and 6800. High level languages hardly existed (Pascal was about the only one) and it was far too slow so everything I wrote was in Assembler. I then moved to management and had other people write the software for me. Now I'm retired I keep thinking I might start again but there aren't enough hours in the day!!
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Well, that's what I call a real programmer!Gandolf wrote:An ex-programer. Control system software in the 1980's using Z80 and 6800. High level languages hardly existed...
I have to revise my previous syntax chart because I got the operator precedence wrong (in my own program, puuh, but it's very hot outside, you know):
Code: Select all
Search Syntax A Search Syntax B Boolean Equivalent
cat cat "cat"
not cat ! cat NOT "cat"
cat and dog cat & dog "cat" AND "dog"
cat and not dog cat & ! dog "cat" AND NOT "dog"
not cat and not dog ! cat & ! dog NOT "cat" AND NOT "dog"
= NOT ("cat" OR "dog")
cat or dog cat | dog "cat" OR "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 NOT "dog")
not pig or cat and dog ! pig | cat & dog NOT "pig" OR ("cat" AND "dog")
Escape character: \
\! cat "! cat"
cat \and dog "cat and dog"
cat \& dog "cat & dog"
etc.
Does everybody find the above system (which includes 2 parallel versions A and B) intuitive and easy to handle and remember? (Note, that the NOT operator does not yet exist in the current version!)
Donald
-
- Site Admin
- Posts: 60567
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
This happened to me, too. I think the ";"-operator for OR should be kept alive as an alternative to " | " and " or " because it's already generally known from file open dialog patterns like "*.ico;*.gif;*.jpg". Right?Gandolf wrote:... I'm quite happy with " & " and " | " even though it caught me out after you'd changed it and I recalled an expression from the history with the ";" and then wondered why it couldn't find the files!!!
Donald
One day later: NO, not a good idea. Forget the ";"-operator.
Donald
Last edited by admin on 04 Aug 2004 15:23, edited 1 time in total.