lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Troy Howard <thowar...@gmail.com>
Subject Re: [jira] Commented: (LUCENENET-392) Arabic Analyzer
Date Tue, 15 Feb 2011 00:00:28 GMT
The QueryParser has those strings hardcoded with no facility for
internationalization. To change them, you'd have to change the values
of the string constant in QueryParser.cs

Specifically, QueryParser.cs, lines 181/182:

public static readonly Operator OR = new Operator("OR");
public static readonly Operator AND = new Operator("AND");

You could simple change those values to some other language, but then
only that language would be available... not exactly
internationalization!

To make it configurable by the end users language, you'd have to
change how the QueryParser uses the Operator class. Mostly, change
properties AND_OPERATOR and OR_OPERATOR to be instance members instead
of static, and set with appropriate instances of Operator class for
the language externally in your app logic.

Generally, I would avoid this route altogether, in order to ensure
searches are compatible with other Lucene-based libraries.

Thanks,
Troy


On Mon, Feb 14, 2011 at 2:25 PM, Ben Foster <ben@planetcloud.co.uk> wrote:
> What needs to be done to support localized query parser constants?
>
> For example, in English I can do a search for "Running AND Trainers NOT
> Nike"
>
> How can I localize the constants for AND / NOT / OR etc.?
>
> Thanks,
> Ben
>
> On 14 February 2011 17:06, Ben Foster <ben@planetcloud.co.uk> wrote:
>
>> I should have used the other zip. That's working fine.
>>
>> Thanks
>>
>> -----Original Message-----
>> From: Ben Foster [mailto:ben@planetcloud.co.uk]
>> Sent: 14 February 2011 16:57
>> To: lucene-net-dev@lucene.apache.org
>> Subject: RE: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>>
>> I'm using the one from the Lucene.Net.Analyzers zip.
>>
>> When I debug I get  Could not find file 'C:\Program Files (x86)\Common
>> Files\Microsoft Shared\DevServer\10.0\ArabicStopWords.txt'.
>>
>> This was even after changing the text file to be an embedded resource.
>>
>> -----Original Message-----
>> From: Digy [mailto:digydigy@gmail.com]
>> Sent: 14 February 2011 16:40
>> To: lucene-net-dev@lucene.apache.org
>> Subject: RE: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>>
>> It is configured as "Embedded Resource" in project file. No need to load
>> explicitly.
>> DIGY
>>
>>
>> -----Original Message-----
>> From: Ben Foster [mailto:ben@planetcloud.co.uk]
>> Sent: Monday, February 14, 2011 5:51 PM
>> To: lucene-net-dev@lucene.apache.org
>> Subject: RE: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>>
>> Quick question - do I need to explicitly load the ArabicStopWords text file
>> or can these be embedded into the assembly?
>>
>> Thanks,
>> Ben
>>
>> -----Original Message-----
>> From: Digy [mailto:digydigy@gmail.com]
>> Sent: 10 February 2011 21:41
>> To: lucene-net-dev@lucene.apache.org
>> Subject: RE: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>>
>> They all contain Apache License 1.1 and compatible with v1.4.3( for ex,
>> they
>> don't implement ReusableTokenStream of Analyzer class) There may be also
>> other fixes in v2.9. I think they can wait till a complete review.
>>
>>
>> DIGY
>>
>>
>>
>>
>> -----Original Message-----
>> From: Prescott Nasser [mailto:geobmx540@hotmail.com]
>> Sent: Thursday, February 10, 2011 11:22 PM
>> To: lucene-net-dev@lucene.apache.org
>> Subject: RE: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>>
>>
>>
>> Would it make sense to also commit the analyzers that Prasha converted and
>> submitted here:
>>
>> https://issues.apache.org/jira/browse/LUCENENET-372
>>
>>
>> ~P
>>
>>
>> > From: digydigy@gmail.com
>> > To: lucene-net-dev@lucene.apache.org
>> > Subject: RE: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>> > Date: Thu, 10 Feb 2011 12:33:37 +0200
>> >
>> > Hi Stefan,
>> >
>> > I don't see it as a "request for permission". It is rather to inform
>> people
>> > about the change who may have different ideas and give a chance to
>> > comment on it if this change breaks something in their own local copy.
>> >
>> > DIGY
>> >
>> >
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Stefan Bodewig [mailto:bodewig@apache.org]
>> > Sent: Thursday, February 10, 2011 12:10 PM
>> > To: lucene-net-dev@lucene.apache.org
>> > Subject: Re: [jira] Commented: (LUCENENET-392) Arabic Analyzer
>> >
>> > On 2011-02-08, Digy (JIRA) wrote:
>> >
>> > > Digy commented on LUCENENET-392:
>> > > --------------------------------
>> >
>> > > If no objections, I am going to commit it in a few days.
>> >
>> > Generally in a healthy project it is way easier to ask for forgiveness
>> > than for permission[1]. It is all under version control so things can
>> > be changed and even removed again easily when anything goes wrong.
>> >
>> > I hope anybody who'd be interested is subscribed to the commits list
>> > and will see the changes and can comment on them later.
>> >
>> > Cheers
>> >
>> > Stefan
>> >
>> > [1] A lesson I had to learn myself
>> > <http://marc.info/?l=ant-dev&m=86951893306302&w=2>
>> >                                         =
>>
>>
>>
>>
>>
>
>
> --
>
> Ben Foster
>
> planetcloud
> The Elms, Hawton
> Newark-on-Trent
> Nottinghamshire
> NG24 3RL
>
> www.planetcloud.co.uk
>

Mime
View raw message