Coder Social home page Coder Social logo

dtsearchparser's People

Contributors

blmille1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dtsearchparser's Issues

Handling Operator Precedence

Hi,

I would like to ask You for a fix with SubExpressions:

So the problem is when I try to parse a regular expression like this: ##(\b[a-z]+[0-9]+\b)
It’s parsed like this: ##

I think it’s because there is a rule which is applied to an expression like this:
(\b[a-z]+[0-9]+\b) which is this expression: '(' expression ')'
That expression is called SubExpression and I don’t think we use it correctly because in that Lucene Query Visitor it is just ignored as I can see.

Instead of ignoring that it would be good to follow an order something like this:

  • parentheses
  • w/n
  • OR
  • AND

So I would like to ask help in resolving these issues:

  • One is that RegExp expression parsing is not working
    (if we remove the subexpression then it works),
  • Other one is that SubExpressions are not handled correctly
    (which signed with parentheses).

I saw an article which describes this situation but it’s slightly different then the one used here, so it would be helpful if someone can show me how can this be applied to the parser's grammar file:
https://stackoverflow.com/questions/5575452/parsing-expressions-with-subexpressions-in-antlr

I found some other missing expressions from that Grammar file which I would like to share with You:

Expressions:

  •   RangeStart expression RangeEnd  # RangeExpression
    
  •   '<' Exists '>'  # ExistsExpression
    

Tokens:

  • Exists : [eE][xX][iI][sS][tT][sS];
  • RangeStart : [[{];
  • RangeEnd : [\]}];

Kind Regards, Attila

exception or error not thrown when rule does not match completely

Parsing
( is this ) love

results in
contents:"is this"

It does not throw any error or exception. Can we have the parser throw exception when entire text to be parsed is not consumed properly?

I tried changing grammar as
query : expr;
to
query : expr EOF;

But that didn't help.

generated query for text inside double quotes

test case* written
is expanded as
SpanNear([contents:test, SpanMultiTermQueryWrapper(contents:case*), contents:written], 0, True)

"test case* written" is expanded as
SpanNear([contents:test, contents: , SpanMultiTermQueryWrapper(contents:case*), contents: , contents:written], 0, True)

Are the blank contents: expected?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.