You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Patrick Turcotte <Pa...@USherbrooke.ca> on 2006/10/13 16:40:27 UTC

QueryParser syntax French Operator : DONE!

Hello!

This may not be the best place for this message, sorry if this is the 
case, but since this is the result of a question I asked here, I decided 
to post it here. If I'm in error, please refer me to the best procedure. 
Thanks!

I've completed the desired "patch". I now have a version of the 
QueryParser that can "understand" the AND, OR and NOT keyword in other 
languages.

1) Patched from revision 454769 of lucene 2.1dev (trunk)
2) The "ant test" target is still successful when the modified 
QueryParser is used
3) It doesn't break actual code
4) The default behavior is the same as before
5) It has to be deliberately activated
6) It use ResourceBundle to find the keywords translation
7) Comes with FRENCH translation
8) Comes with JUnit testCases
9) Adds 1 public method to QueryParser

So, now, how do I go about sending it all to the those who can decide to 
integrate it? Where? In what format? Etc.

Thanks,

Patrick Turcotte



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: QueryParser syntax French Operator : DONE!

Posted by Patrick Turcotte <pa...@gmail.com>.
Thanks Mark!

I have to mention Benoit Mercier here who worked with me so we could
understand how to expand a term and use TOKEN_MGR_DECLS.

Patrick

On 10/13/06, Mark Miller <ma...@gmail.com> wrote:
>
> Great work Patrick. I was unfamiliar with the use of TOKEN_MGR_DECLS.
> Looks
> like a powerfull feature for dynamic token selection. Thanks a lot,
>
> - Mark
>
>
>

Re: QueryParser syntax French Operator : DONE!

Posted by Mark Miller <ma...@gmail.com>.
Great work Patrick. I was unfamiliar with the use of TOKEN_MGR_DECLS. Looks
like a powerfull feature for dynamic token selection. Thanks a lot,

- Mark

On 10/13/06, Patrick Turcotte <Pa...@usherbrooke.ca> wrote:
>
> Mark Miller wrote:
> > Could you say in a few words what you did to accomplish this? I know
> that
> > you mentioned you used a resource bundle, but what part of the code
> reads
> > this resource bundle? What method did you use to get by the JavaCC
> > issues?
> >
>     Basically:
>
>     * I used TOKEN_MGR_DECLS to declare fields in the TokenManager class.
>
>     * When setting a Locale or setting the useLocalizedOperators options
>       (new method) in QueryParser, I fetch, with ResourceBundle, the
>       strings to match against and set (with token_source.fieldName)
>       values to be used by the TokenManager class
>     * I expanded the token <TERM> to do further processing (as per
>       JavaCC syntax), which create a TokenLixicalActions(Token
>       matchedToken) in the TokenManager class with syntax:
>
> <TERM: <_TERM_START_CHAR> (<_TERM_CHAR>)* >
> {
>     // THIS Will end up in TokenLixicalActions(Token matchedToken) method
>     // DEFINE java processing with matchedToken.image to get to the
> matched string, set matchedToken.kind accordingly.
>     // USES fields set by the QueryParser to decide on behavior
> }
>
>     Hope this answer your question.
>
> Patrick
> > thanks,
> >
> > -Mark
> >
> > On 10/13/06, Patrick Turcotte <Pa...@usherbrooke.ca> wrote:
> >>
> >> Hello!
> >>
> >> This may not be the best place for this message, sorry if this is the
> >> case, but since this is the result of a question I asked here, I
> decided
> >> to post it here. If I'm in error, please refer me to the best
> procedure.
> >> Thanks!
> >>
> >> I've completed the desired "patch". I now have a version of the
> >> QueryParser that can "understand" the AND, OR and NOT keyword in other
> >> languages.
> >>
> >> 1) Patched from revision 454769 of lucene 2.1dev (trunk)
> >> 2) The "ant test" target is still successful when the modified
> >> QueryParser is used
> >> 3) It doesn't break actual code
> >> 4) The default behavior is the same as before
> >> 5) It has to be deliberately activated
> >> 6) It use ResourceBundle to find the keywords translation
> >> 7) Comes with FRENCH translation
> >> 8) Comes with JUnit testCases
> >> 9) Adds 1 public method to QueryParser
> >>
> >> So, now, how do I go about sending it all to the those who can decide
> to
> >> integrate it? Where? In what format? Etc.
> >>
> >> Thanks,
> >>
> >> Patrick Turcotte
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
>
>
> --
> Patrick Turcotte
> ------------------------------------
> Patrick.Turcotte@USherbrooke.ca
> (819) 821-8000, poste 63234
> 1-800-267-8337 poste 63234
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: QueryParser syntax French Operator : DONE!

Posted by Patrick Turcotte <Pa...@USherbrooke.ca>.
Mark Miller wrote:
> Could you say in a few words what you did to accomplish this? I know that
> you mentioned you used a resource bundle, but what part of the code reads
> this resource bundle? What method did you use to get by the JavaCC 
> issues?
>
    Basically:

    * I used TOKEN_MGR_DECLS to declare fields in the TokenManager class.

    * When setting a Locale or setting the useLocalizedOperators options
      (new method) in QueryParser, I fetch, with ResourceBundle, the
      strings to match against and set (with token_source.fieldName)
      values to be used by the TokenManager class
    * I expanded the token <TERM> to do further processing (as per
      JavaCC syntax), which create a TokenLixicalActions(Token
      matchedToken) in the TokenManager class with syntax:

<TERM: <_TERM_START_CHAR> (<_TERM_CHAR>)* >
{
    // THIS Will end up in TokenLixicalActions(Token matchedToken) method
    // DEFINE java processing with matchedToken.image to get to the 
matched string, set matchedToken.kind accordingly.
    // USES fields set by the QueryParser to decide on behavior
}

    Hope this answer your question.

Patrick
> thanks,
>
> -Mark
>
> On 10/13/06, Patrick Turcotte <Pa...@usherbrooke.ca> wrote:
>>
>> Hello!
>>
>> This may not be the best place for this message, sorry if this is the
>> case, but since this is the result of a question I asked here, I decided
>> to post it here. If I'm in error, please refer me to the best procedure.
>> Thanks!
>>
>> I've completed the desired "patch". I now have a version of the
>> QueryParser that can "understand" the AND, OR and NOT keyword in other
>> languages.
>>
>> 1) Patched from revision 454769 of lucene 2.1dev (trunk)
>> 2) The "ant test" target is still successful when the modified
>> QueryParser is used
>> 3) It doesn't break actual code
>> 4) The default behavior is the same as before
>> 5) It has to be deliberately activated
>> 6) It use ResourceBundle to find the keywords translation
>> 7) Comes with FRENCH translation
>> 8) Comes with JUnit testCases
>> 9) Adds 1 public method to QueryParser
>>
>> So, now, how do I go about sending it all to the those who can decide to
>> integrate it? Where? In what format? Etc.
>>
>> Thanks,
>>
>> Patrick Turcotte
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>


-- 
Patrick Turcotte
------------------------------------
Patrick.Turcotte@USherbrooke.ca
(819) 821-8000, poste 63234
1-800-267-8337 poste 63234



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: QueryParser syntax French Operator : DONE!

Posted by Mark Miller <ma...@gmail.com>.
Could you say in a few words what you did to accomplish this? I know that
you mentioned you used a resource bundle, but what part of the code reads
this resource bundle? What method did you use to get by the JavaCC issues?

thanks,

-Mark

On 10/13/06, Patrick Turcotte <Pa...@usherbrooke.ca> wrote:
>
> Hello!
>
> This may not be the best place for this message, sorry if this is the
> case, but since this is the result of a question I asked here, I decided
> to post it here. If I'm in error, please refer me to the best procedure.
> Thanks!
>
> I've completed the desired "patch". I now have a version of the
> QueryParser that can "understand" the AND, OR and NOT keyword in other
> languages.
>
> 1) Patched from revision 454769 of lucene 2.1dev (trunk)
> 2) The "ant test" target is still successful when the modified
> QueryParser is used
> 3) It doesn't break actual code
> 4) The default behavior is the same as before
> 5) It has to be deliberately activated
> 6) It use ResourceBundle to find the keywords translation
> 7) Comes with FRENCH translation
> 8) Comes with JUnit testCases
> 9) Adds 1 public method to QueryParser
>
> So, now, how do I go about sending it all to the those who can decide to
> integrate it? Where? In what format? Etc.
>
> Thanks,
>
> Patrick Turcotte
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: QueryParser syntax French Operator : DONE!

Posted by Patrick Turcotte <Pa...@USherbrooke.ca>.
Submitted to Jira with key LUCENE-682

Patrick

Grant Ingersoll wrote:
> Hi Patrick,
>
> Thanks for the work.  Create a bug in JIRA and upload a patch (see svn 
> diff).  See the Wiki for information on how to contribute.
>
> Thanks,
> Grant
>



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: QueryParser syntax French Operator : DONE!

Posted by Grant Ingersoll <gs...@apache.org>.
Hi Patrick,

Thanks for the work.  Create a bug in JIRA and upload a patch (see  
svn diff).  See the Wiki for information on how to contribute.

Thanks,
Grant

On Oct 13, 2006, at 10:40 AM, Patrick Turcotte wrote:

> Hello!
>
> This may not be the best place for this message, sorry if this is  
> the case, but since this is the result of a question I asked here,  
> I decided to post it here. If I'm in error, please refer me to the  
> best procedure. Thanks!
>
> I've completed the desired "patch". I now have a version of the  
> QueryParser that can "understand" the AND, OR and NOT keyword in  
> other languages.
>
> 1) Patched from revision 454769 of lucene 2.1dev (trunk)
> 2) The "ant test" target is still successful when the modified  
> QueryParser is used
> 3) It doesn't break actual code
> 4) The default behavior is the same as before
> 5) It has to be deliberately activated
> 6) It use ResourceBundle to find the keywords translation
> 7) Comes with FRENCH translation
> 8) Comes with JUnit testCases
> 9) Adds 1 public method to QueryParser
>
> So, now, how do I go about sending it all to the those who can  
> decide to integrate it? Where? In what format? Etc.
>
> Thanks,
>
> Patrick Turcotte
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

--------------------------
Grant Ingersoll
Sr. Software Engineer
Center for Natural Language Processing
Syracuse University
335 Hinds Hall
Syracuse, NY 13244
http://www.cnlp.org




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org