keithstric / booleansearchparser Goto Github PK
View Code? Open in Web Editor NEWA boolean search string parser
A boolean search string parser
Tokens which are children (i.e. inside quotes or parens) are not properly identified as children
When initially parsing a search string. The reported rule for a match may be whitespace. However, the token is actually a term and NOT whitespace. This signifies that this part of the search string was actually matched by 2 rules and the rule for a term was the first match, and rule for whitespace was the second match. This signifies that the rule property should be an array.
Add span tags around terms.
Use a non-breaking space for whitespace.
Add div tags to groupings.
For example:
this AND ("other thing" OR that)
Should provide this html:
<span class="term">this</span> <span class="operator">AND</span>
<div class="grouping">
<span class="paren">(</span>
<div class="grouping">
<span class="quote">"</span>
<span class="term">other thing</span>
<span class="quote">"</span>
</div>
<span class="operator">OR</span> <span class="term">that</span>
<span class="paren">)</span>
</div>
When a token is an Operator or Possible Operator, it should have the text leading up to the operator. For example:
"this AND that NOT something"
The token for "AND" should have a phrase of "this AND". The token for "NOT" should have a phrase of "that NOT".
Currently, the phrase property of operators is always undefined.
There is currently no way to select the rules or validation rules that will be used for the parsing operation. We should be able to define which rules will be used without having to modify the defined rules.
Not sure this is actually a bug per-se. Maybe "selected rules" is redundant since we always have the default rules to fall back on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.