1

I'm trying to use SnowBallAnalyzer in PyLucene but I always get an error saying: InvalidArgsError when I try to create an instance of it like this:

analyzer = SnowBallAnalyzer("Spanish")

or

analyzer = SnowBallAnalyzer("Spanish", STOPWORDS)

What I really need is i.e if I search for "FĂștbol", I should obtain the documents that have the word "futbol" or "fĂștbol". So... I would like to apply SnowBallAnalyzer to the text I would like to index an to the query.

Any help will be appreciated.

Thanks in advance.

Harph
  • 2,250
  • 2
  • 17
  • 16

1 Answers1

1

I don't know pylucene very well as I only work with the java version but as far as I know pylucene is accessing the java implementation.

If this is the case you are missing the Version parameter in the constructor.

SnowballAnalyzer(Version matchVersion, String name, String[] stopWords)

As SnowballAnalyzer has been deprecated in lucene 3.1.0, I suggest you directly use the spanish analyzer.

SpanishAnalyzer(Version matchVersion, Set<?> stopwords) 
BenMorel
  • 34,448
  • 50
  • 182
  • 322
csupnig
  • 3,327
  • 1
  • 24
  • 22