lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "karl wettin" <karl.wet...@gmail.com>
Subject Re: QueryParser syntax French Operator
Date Sun, 08 Oct 2006 14:14:26 GMT
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


Mime
View raw message