[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Any package for boolean search?
From: |
Jean Louis |
Subject: |
Re: Any package for boolean search? |
Date: |
Fri, 27 Dec 2024 14:05:40 +0300 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
* Joel Reicher <joel.reicher@gmail.com> [2024-12-27 02:16]:
> Jean Louis <bugs@gnu.support> writes:
>
> > * Joel Reicher <joel.reicher@gmail.com> [2024-12-26 09:03]:
>
> [...]
>
> > > Is there an Emacs or elisp aspect to this question I might be
> > > missing?
> >
> > I don't know what you mean. I am looking for some ready package that
> > provides maybe string searching within other strings, by using boolean
> > operators.
>
> Why are you expecting this to be a package? Strings are a native/primitive
> elisp datatype.
Thanks, though, I do not expect, I am asking if someone knows about
it. Those AND, OR, NOT are pretty classic, not so?
> (info "(elisp) Text Comparison")
I can't find there anything related, sure as basic functions is very
useful, but doesn't parse the query.
- cat dog -- I would use this with AND automatically; but maybe add OR
on the end of results;
- cat and dog -- this is ONLY AND, without OR results
- cat dog OR giraffe in Africa -- here I would parse it as:
- cat AND dog -- is it there?
- but it can be also "giraffe AND Africa"
There are too many combinations and I have to make it so that I can
first parse the query into smaller pieces.
Then this query is dispatched to more basic functions.
> and also string-match at (info "(elisp) Regexp Search")
Sure! Thanks much. I am using those functions and it is useful let's
say, if I need to search with "OR" some few words.
But what if there are complex queries:
cat plays with dog OR dog plays with dogs NOT giraffe
or maybe this way:
(cat plays with dog) OR (dog plays with dogs) NOT giraffe
Then I have to parse it, separate it:
- NOT giraffe
- is there any result for cat? But no giraffe
- or any result for dog? But no giraffe
I hope you understand the meaning by that example.
It is called Boolean query parser, but when I started this question I
did not know the title. Now I know it.
Here is example in PHP
skipperbent/pecee-boolean-query-parser: Convert a boolean search query into a
query that is compatible with a fulltext search.
https://github.com/skipperbent/pecee-boolean-query-parser
As there is apparently no such ready package in Emacs, then I will go
slow and start with functional examples:
1. For any query, find all occurences matching exactly; for query "cat
plays" it will find "Cat plays with ball"
2. Parse words and find all occurences matching same words but with
AND: for query "cat plays" it will also find "Cat likes doggy which
plays with the ball"
Then I can think from there how to develop OR and NOT.
--
Jean Louis
- Any package for boolean search?, Jean Louis, 2024/12/25
- RE: [External] : Any package for boolean search?, Drew Adams, 2024/12/25
- Re: Any package for boolean search?, Joel Reicher, 2024/12/26
- Re: Any package for boolean search?, Jean Louis, 2024/12/26
- Re: Any package for boolean search?, Joel Reicher, 2024/12/26
- Re: Any package for boolean search?,
Jean Louis <=
- Re: Any package for boolean search?, Joel Reicher, 2024/12/27
- Re: Any package for boolean search?, Jean Louis, 2024/12/28
- Re: Any package for boolean search?, Joel Reicher, 2024/12/28
- Re: Any package for boolean search?, Jean Louis, 2024/12/28
Re: Any package for boolean search?, Jean Louis, 2024/12/26