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 Ivan Kozlov <th...@mega.rubeg.com> on 2004/01/24 21:50:34 UTC

Using Russian analyzer in Luke

Hello lucene-user,

  I tryed Luke to try to search in my Lucene database and discovered
  that when I try to select russian analyzer it shows me next error:
  ------
java.lang.NoSuchMethodException: org.apache.lucene.analysis.ru.RussianAnalyzer.<init>()
        at java.lang.Class.getConstructor0(Unknown Source)
        at java.lang.Class.getConstructor(Unknown Source)
        at luke.Luke.createQueryParser(Luke.java:809)
        at luke.Luke.showParsed(Luke.java:824)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at thinlet.Thinlet.invokeImpl(Thinlet.java:4274)
        at thinlet.Thinlet.invoke(Thinlet.java:4243)
        at thinlet.Thinlet.closeCombo(Thinlet.java:858)
        at thinlet.Thinlet.handleMouseEvent(Thinlet.java:3632)
        at thinlet.Thinlet.processEvent(Thinlet.java:2680)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Analyzer 'org.apache.lucene.analysis.ru.RussianAnalyzer' error: org.apache.lucene.analysis.ru.RussianAnalyzer.<init>(). Using StandardAnalyzer.
  ------
  and uses default analyzer

-- 
Best regards,
 Ivan                          mailto:theses@mega.rubeg.com


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


Re: Using Russian analyzer in Luke

Posted by Pierrick Brihaye <pi...@wanadoo.fr>.
Hi Ivan,

>   I tryed Luke to try to search in my Lucene database and discovered
>   that when I try to select russian analyzer it shows me next error:
>   ------
> java.lang.NoSuchMethodException:
org.apache.lucene.analysis.ru.RussianAnalyzer.<init>()
>         at java.lang.Class.getConstructor0(Unknown Source)
>         at java.lang.Class.getConstructor(Unknown Source)
>         at luke.Luke.createQueryParser(Luke.java:809)

Remember that Luke can be launched in 2 ways :

1)
>A standalone JAR, containing Luke and Lucene 1.3-final: lukeall.jar

2)
>As two separate JARs, one containing Luke and the other pristine Lucene
1.3-final JAR (just signed, so that it can be used with Java WS)
...
>Remember to put both JARs on your classpath, e.g.: java -classpath
luke.jar;lucene.jar luke.Luke

It looks like you are using the second one and that your "lucene.jar" does
not contain the org.apache.lucene.analysis.ru.RussianAnalyzer class.

Cheers,

p.b.



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


Re: See Lucene in action at Furl...

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 26, 2004, at 1:42 PM, Doug Cutting wrote:
> This is cool.  Should we put it on the "Powered By Lucene" page?

I've gone ahead and added this to CVS.  If, for some reason, you don't 
want this listed on Lucene's powered by page, just let me know and I'll 
take it off.  (I've not been the one responsible for updating the live 
site, though, so it may be some time before it appears live)

	Erik

>
> Doug
>
> Michael Giles wrote:
>> Furl - http://www.furl.net
>> I've been meaning to write to the list about Furl for a while as it 
>> is a pretty cool use of Lucene (Otis finally connected the dots and 
>> tracked me down last week).  Furl (http://www.furl.net) is basically 
>> an Internet filing cabinet for useful web pages.  Or to put it in 
>> Lucene-geek terms, it is a browser-based app that gives you your own 
>> Lucene index of all the interesting web pages/articles you find 
>> online.
>> I read all of my news online and there just isn't a good way to keep 
>> track of it and then recall it at a later date (i.e. "What the heck 
>> was that article I read about...?").  Bookmarks are really not built 
>> for that task.  And blogs aren't either (because you can only search 
>> on your comments, which I never remember).  Thus, Furl was born last 
>> spring with some traits of bookmarks (i.e. single click in your 
>> browser), some traits of blogs (i.e. bookmarklets, links, comments, 
>> RSS feeds), some traits of Google (i.e. full-text index of web 
>> content) and a bunch of its own mojo.
>> I just launched it publicly last week and folks are signing up fast 
>> and really enjoying it.  I think it's damn useful (i.e. one of the 
>> few things I use every day) so check it out.  And if you want to play 
>> around with search without signing up, you can use the demo account 
>> or search my public entries (http://www.furl.net/members/mgiles) for 
>> things like "lucene", "genetics", "whales", whatever.
>> It certainly wouldn't have been possible without Lucene.  Enjoy!
>> -Mike
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


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


Re: See Lucene in action at Furl...

Posted by Doug Cutting <cu...@apache.org>.
This is cool.  Should we put it on the "Powered By Lucene" page?

Doug

Michael Giles wrote:
> 
> Furl - http://www.furl.net
> 
> I've been meaning to write to the list about Furl for a while as it is a 
> pretty cool use of Lucene (Otis finally connected the dots and tracked 
> me down last week).  Furl (http://www.furl.net) is basically an Internet 
> filing cabinet for useful web pages.  Or to put it in Lucene-geek terms, 
> it is a browser-based app that gives you your own Lucene index of all 
> the interesting web pages/articles you find online.
> 
> I read all of my news online and there just isn't a good way to keep 
> track of it and then recall it at a later date (i.e. "What the heck was 
> that article I read about...?").  Bookmarks are really not built for 
> that task.  And blogs aren't either (because you can only search on your 
> comments, which I never remember).  Thus, Furl was born last spring with 
> some traits of bookmarks (i.e. single click in your browser), some 
> traits of blogs (i.e. bookmarklets, links, comments, RSS feeds), some 
> traits of Google (i.e. full-text index of web content) and a bunch of 
> its own mojo.
> 
> I just launched it publicly last week and folks are signing up fast and 
> really enjoying it.  I think it's damn useful (i.e. one of the few 
> things I use every day) so check it out.  And if you want to play around 
> with search without signing up, you can use the demo account or search 
> my public entries (http://www.furl.net/members/mgiles) for things like 
> "lucene", "genetics", "whales", whatever.
> 
> It certainly wouldn't have been possible without Lucene.  Enjoy!
> 
> -Mike
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


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


See Lucene in action at Furl...

Posted by Michael Giles <mg...@visionstudio.com>.
Furl - http://www.furl.net

I've been meaning to write to the list about Furl for a while as it is a 
pretty cool use of Lucene (Otis finally connected the dots and tracked me 
down last week).  Furl (http://www.furl.net) is basically an Internet 
filing cabinet for useful web pages.  Or to put it in Lucene-geek terms, it 
is a browser-based app that gives you your own Lucene index of all the 
interesting web pages/articles you find online.

I read all of my news online and there just isn't a good way to keep track 
of it and then recall it at a later date (i.e. "What the heck was that 
article I read about...?").  Bookmarks are really not built for that 
task.  And blogs aren't either (because you can only search on your 
comments, which I never remember).  Thus, Furl was born last spring with 
some traits of bookmarks (i.e. single click in your browser), some traits 
of blogs (i.e. bookmarklets, links, comments, RSS feeds), some traits of 
Google (i.e. full-text index of web content) and a bunch of its own mojo.

I just launched it publicly last week and folks are signing up fast and 
really enjoying it.  I think it's damn useful (i.e. one of the few things I 
use every day) so check it out.  And if you want to play around with search 
without signing up, you can use the demo account or search my public 
entries (http://www.furl.net/members/mgiles) for things like "lucene", 
"genetics", "whales", whatever.

It certainly wouldn't have been possible without Lucene.  Enjoy!

-Mike



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


RE: Using Russian analyzer in Luke

Posted by Pasha Bizhan <fc...@ok.ru>.
Hi, 

> From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
> 
> I'd like to keep the no-arg constructor there, but perhaps if 
> there is a more commonly used character set than 
> RussianUnicode we could switch to that.
> 
> Any objections?

It's crucial decision and it's a good reason for new holy war :))
"Of two evils choose the less" -  Keep the RussianUnicode :)

Erik, really, I don't know. I like CP1251, but it's my opinion.

Pasha Bizhan
http://www.LuceneDotNet.com


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


Re: Using Russian analyzer in Luke

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 25, 2004, at 5:36 PM, Pasha Bizhan wrote:
> My code is only example  and RussianCharsets.RussianUnicode too.
> We use RussianCharsets.CP1251. But other people can use other charset.
>
> I think that Russian Analyser must not has no-arg constructor.
> The choise of default charset is not evident.
> The user must specify charset.
>
> I thin that original problem is Luke's problem, not Russian Analyser.
>
> Do you understand me?

Yes, I understand now.  I think it is reasonable to have a no-arg 
constructor in this case though.  Even if there is no one standard 
character set, it will be up to the user of the API to specify one if 
the default is not good enough.

I'd like to keep the no-arg constructor there, but perhaps if there is 
a more commonly used character set than RussianUnicode we could switch 
to that.

Any objections?

	Erik


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


RE: Using Russian analyzer in Luke

Posted by Pasha Bizhan <fc...@ok.ru>.
Hi, 

> From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
> 
> On Jan 25, 2004, at 2:53 PM, Pasha Bizhan wrote:
> > Hi,
> >
> > I'm not sure that's rightly. Because Russian unicode charset, KOI 
> > charset and win1251 charset is equal in use. May be unicode 
> charset is 
> > less common.
> > I guess so Russian Analyser hasn't no-arg constructor.
> 
> Pasha - my apologies, but I'm not following what you mean 
> here.  Is there an issue with the change I made to the 
> RussianAnalyzer?

Sorry for my English.

All russian charset is equal. 
I can't choice default charset for no-arg constructor.

My code is only example  and RussianCharsets.RussianUnicode too.
We use RussianCharsets.CP1251. But other people can use other charset.

> public RussianAnalyzer() {
> 	this.charset = RussianCharsets.UnicodeRussian;
> 	stoptable =
StopFilter.makeStopTable(makeStopWords(RussianCharsets.UnicodeRussian));
> }

I think that Russian Analyser must not has no-arg constructor.
The choise of default charset is not evident.
The user must specify charset.

I thin that original problem is Luke's problem, not Russian Analyser.

Do you understand me?

 > My preference, actually, is for Lucene 2.0 to have all of 
> these language-specific analyzers separate from the core.

+1.

Pasha Bizhan
http://www.LuceneDotNet.com


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


Re: Using Russian analyzer in Luke

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 25, 2004, at 2:53 PM, Pasha Bizhan wrote:
> Hi,
>
> I'm not sure that's rightly. Because Russian unicode charset, KOI 
> charset
> and win1251 charset is equal in use. May be unicode charset is less 
> common.
> I guess so Russian Analyser hasn't no-arg constructor.

Pasha - my apologies, but I'm not following what you mean here.  Is 
there an issue with the change I made to the RussianAnalyzer?

My preference, actually, is for Lucene 2.0 to have all of these 
language-specific analyzers separate from the core.

	Erik


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


RE: Using Russian analyzer in Luke

Posted by Pasha Bizhan <fc...@ok.ru>.
Hi, 

I'm not sure that's rightly. Because Russian unicode charset, KOI charset 
and win1251 charset is equal in use. May be unicode charset is less common.
I guess so Russian Analyser hasn't no-arg constructor.

Pasha Bizhan
http://www.LuceneDotNet.com

> -----Original Message-----
> From: Erik Hatcher [mailto:erik@ehatchersolutions.com] 
> Sent: Sunday, January 25, 2004 17:23
> To: Lucene Users List
> Subject: Re: Using Russian analyzer in Luke
> 
> 
> On Jan 24, 2004, at 6:44 PM, Pasha Bizhan wrote:
> > Luke use default ctor for Analyser, but Russian Analyser doesn't 
> > contain it.
> > And German Analyser too -  try Luke and the error will be the same.
> >
> > You can add this code into RussianAnalyzer.java and enjoy:
> > public RussianAnalyzer() {
> > 	this.charset = RussianCharsets.UnicodeRussian;
> > 	stoptable =
> > 
> StopFilter.makeStopTable(makeStopWords(RussianCharsets.UnicodeRussian)
> > )
> > ;
> > }
> >
> 
> GermanAnalyzer has a no-arg constructor - Luke can use it 
> fine.  I've just added the no-arg constructor to the 
> RussianAnalyzer as you've specified above.  Thanks!
> 
> 	Erik
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 


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


Re: Using Russian analyzer in Luke

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 24, 2004, at 6:44 PM, Pasha Bizhan wrote:
> Luke use default ctor for Analyser, but Russian Analyser doesn't  
> contain it.
> And German Analyser too -  try Luke and the error will be the same.
>
> You can add this code into RussianAnalyzer.java and enjoy:
> public RussianAnalyzer() {
> 	this.charset = RussianCharsets.UnicodeRussian;
> 	stoptable =
> StopFilter.makeStopTable(makeStopWords(RussianCharsets.UnicodeRussian)) 
> ;
> }
>

GermanAnalyzer has a no-arg constructor - Luke can use it fine.  I've  
just added the no-arg constructor to the RussianAnalyzer as you've  
specified above.  Thanks!

	Erik



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


Re: Using Russian analyzer in Luke

Posted by Andrzej Bialecki <ab...@getopt.org>.
Pasha Bizhan wrote:

> Hi, 
> 
> 
>>From: Ivan Kozlov [mailto:theses@mega.rubeg.com] 
>>
>>  I tryed Luke to try to search in my Lucene database and discovered
>>  that when I try to select russian analyzer it shows me next error:
>>  ------
> 
> 
> It's Luke's feature. And Russian language specific - 3  (and more) charset
> for one language :) 
> 
> Luke use default ctor for Analyser, but Russian Analyser doesn't contain it.
> And German Analyser too -  try Luke and the error will be the same.
> 
> You can add this code into RussianAnalyzer.java and enjoy:
> public RussianAnalyzer() {
> 	this.charset = RussianCharsets.UnicodeRussian;
> 	stoptable =
> StopFilter.makeStopTable(makeStopWords(RussianCharsets.UnicodeRussian));
> }

Thanks for spotting this bug, and providing a fix. I believe Erik 
already applied this patch.

If you are using Java WebStart, you will have to wait till I update the 
version on my website (which will be another couple of days), but in the 
meantime you can just rebuild Luke from sources, using the latest Lucene.

-- 
Best regards,
Andrzej Bialecki

-------------------------------------------------
Software Architect, System Integration Specialist
CEN/ISSS EC Workshop, ECIMF project chair
EU FP6 E-Commerce Expert/Evaluator
-------------------------------------------------
FreeBSD developer (http://www.freebsd.org)


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


RE: Using Russian analyzer in Luke

Posted by Pasha Bizhan <fc...@ok.ru>.
Hi, 

> From: Ivan Kozlov [mailto:theses@mega.rubeg.com] 
> 
>   I tryed Luke to try to search in my Lucene database and discovered
>   that when I try to select russian analyzer it shows me next error:
>   ------

It's Luke's feature. And Russian language specific - 3  (and more) charset
for one language :) 

Luke use default ctor for Analyser, but Russian Analyser doesn't contain it.
And German Analyser too -  try Luke and the error will be the same.

You can add this code into RussianAnalyzer.java and enjoy:
public RussianAnalyzer() {
	this.charset = RussianCharsets.UnicodeRussian;
	stoptable =
StopFilter.makeStopTable(makeStopWords(RussianCharsets.UnicodeRussian));
}


Pasha Bizhan
http://www.LuceneDotNet.com


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