Hi, I was thinking of something along those lines.
Last week, I was able to take time to understand the JavaCC syntax and possiblities. I have some cleaning up, testing and documentation to do, but basically, I was able to expand the AND / OR / NOT patterns at runtime using the ResourceBundle paradigm. I'll keep you posted. Patrick > -----Message d'origine----- > De : karl wettin [mailto:[EMAIL PROTECTED] > Envoyé : 8 octobre, 2006 10:14 > À : java-user@lucene.apache.org > Objet : Re: QueryParser syntax French Operator > > > On 10/8/06, Otis Gospodnetic <[EMAIL PROTECTED]> wrote: > > Hi Patrick, > > > > If I were trying to do this, I'd modify QueryParser.jj to > construct the grammar for boolean operators based on something > like Locale (or LANG env. variable?). I'd try adding code a la: > > en_AND = AND > > en_OR = OR > > en_NOT = NOT > > fr_AND = ET > > fr_OR = OU > > fr_NOT = SAUF > > > > And then: > > if (locale is 'fr') > > // construct the grammar with fr_* > > ... > > > > Something like that. > > It is a good thought, but as number of locales grows with similar > languages you'll get deterministic errors in the lexer. So I would > absolutely recommend one grammar file per language. Not sure if JavaCC > allows inheritance, but with ANTlr this would be a very simple and > effective way to solve the problem. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]