Name: boolean-expression-js
Owner: Bloom
Description: A javascript/node.js library for compiling and evaluating boolean search terms, using ReParse.
Created: 2011-10-10 16:17:44.0
Updated: 2017-07-20 15:35:16.0
Pushed: 2012-07-11 22:54:15.0
Homepage: https://github.com/bloomtime/boolean-expression-js
Size: 112
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Uses https://github.com/weaver/ReParse
Compiles and evaluates simple boolean search expressions, e.g.
parsed = new Expression("John AND Paul AND Ringo AND George");
rt.equal(parsed.test("John"), false);
rt.equal(parsed.test("Paul"), false);
rt.equal(parsed.test("Ringo"), false);
rt.equal(parsed.test("George"), false);
rt.equal(parsed.test("John Paul George Ringo"), true);
rt.equal(parsed.test("Ringo George Paul John"), true);
Supports parens for disambiguation. Supports AND, OR and NOT. Supports quotes for phrases. Case insensitive.
See tests for more examples.
TODO: