You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Stephen Lewis Bianamara <st...@gmail.com> on 2022/01/25 18:10:31 UTC

DutchAnalyzer fails to create with parameter stopwords: null

Hi Lucenenet team,

I noticed a small issue with the DutchAnalyzer on beta-0015. When creating
it with the parameter stopwords: null I get this error:

Error Message

System.ArgumentNullException : Value cannot be null.
Parameter name: source

Stacktrace

   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1
source, Func`2 selector)
   at Lucene.Net.Analysis.Util.CharArraySet.Copy[T](LuceneVersion
matchVersion, ICollection`1 set)
   at Lucene.Net.Analysis.Nl.DutchAnalyzer..ctor(LuceneVersion
matchVersion, CharArraySet stopwords, CharArraySet stemExclusionTable,
CharArrayMap`1 stemOverrideDict)
   at Panopto.Intelligence.Linguistics.Analysis.MultilanguageAnalyzer.GetAnalyzer(ContentLanguage
language) in C:\w\workspace\opto_panopto-core_rel_rtc_12.1.0\Panopto\Intelligence\Linguistics\Analysis\MultilanguageAnalyzer.cs:line
45
   at Panopto.Intelligence.Tests.Linguistics.TokenizerTests.CreateMultilanguageAnalyzer(ContentLanguage
contentLanguage) in
C:\w\workspace\opto_panopto-core_rel_rtc_12.1.0\Panopto\Intelligence\Tests\Linguistics\TokenizerTests.cs:line
101


Of course this is easy to get around by passing in an empty list so not a
huge deal, but could be good to fix for ease of adoption. I didn't find
anything in the issues
<https://github.com/apache/lucenenet/issues?q=is%3Aissue++DutchAnalyzer>.

 Should I file an issue?

Cheers,
Stephen

RE: DutchAnalyzer fails to create with parameter stopwords: null

Posted by Ron Clabo <Ro...@GiftOasis.com>.
Thanks for the note.   It's my understanding that this behavior is consistent with the behavior in Java Lucene.  Requiring that an empty ChartArraySet be passed rather than null is consistent with other aspect of Lucene as well.  I think the best way to improve the API here is to provide inline documentation for the stopwords parameter that indicates that an empty set should be passed if no stop words are used and that null is not allowed.

If you want to submit a PR for that we'd be happy to accept it.

-Ron

-----Original Message-----
From: Stephen Lewis Bianamara [mailto:stephen.bianamara@gmail.com] 
Sent: Tuesday, January 25, 2022 1:11 PM
To: user@lucenenet.apache.org
Subject: DutchAnalyzer fails to create with parameter stopwords: null

Hi Lucenenet team,

I noticed a small issue with the DutchAnalyzer on beta-0015. When creating
it with the parameter stopwords: null I get this error:

Error Message

System.ArgumentNullException : Value cannot be null.
Parameter name: source

Stacktrace

   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1
source, Func`2 selector)
   at Lucene.Net.Analysis.Util.CharArraySet.Copy[T](LuceneVersion
matchVersion, ICollection`1 set)
   at Lucene.Net.Analysis.Nl.DutchAnalyzer..ctor(LuceneVersion
matchVersion, CharArraySet stopwords, CharArraySet stemExclusionTable,
CharArrayMap`1 stemOverrideDict)
   at Panopto.Intelligence.Linguistics.Analysis.MultilanguageAnalyzer.GetAnalyzer(ContentLanguage
language) in C:\w\workspace\opto_panopto-core_rel_rtc_12.1.0\Panopto\Intelligence\Linguistics\Analysis\MultilanguageAnalyzer.cs:line
45
   at Panopto.Intelligence.Tests.Linguistics.TokenizerTests.CreateMultilanguageAnalyzer(ContentLanguage
contentLanguage) in
C:\w\workspace\opto_panopto-core_rel_rtc_12.1.0\Panopto\Intelligence\Tests\Linguistics\TokenizerTests.cs:line
101


Of course this is easy to get around by passing in an empty list so not a
huge deal, but could be good to fix for ease of adoption. I didn't find
anything in the issues
<https://github.com/apache/lucenenet/issues?q=is%3Aissue++DutchAnalyzer>.

 Should I file an issue?

Cheers,
Stephen