lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Turcotte <patrick.turco...@usherbrooke.ca>
Subject RE: QueryParser syntax French Operator
Date Mon, 09 Oct 2006 21:59:40 GMT

	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:karl.wettin@gmail.com]
> Envoyé : 8 octobre, 2006 10:14
> À : java-user@lucene.apache.org
> Objet : Re: QueryParser syntax French Operator
>
>
> On 10/8/06, Otis Gospodnetic <otis_gospodnetic@yahoo.com> 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: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>


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


Mime
View raw message