|
1 | | -using J2N.Collections.Generic.Extensions; |
2 | 1 | using Lucene.Net.Analysis.Cjk; |
3 | 2 | using Lucene.Net.Analysis.Core; |
4 | 3 | using Lucene.Net.Analysis.Ja.Dict; |
|
8 | 7 | using System.Collections.Generic; |
9 | 8 | using System.IO; |
10 | 9 | using JCG = J2N.Collections.Generic; |
| 10 | +#nullable enable |
11 | 11 |
|
12 | 12 | namespace Lucene.Net.Analysis.Ja |
13 | 13 | { |
@@ -36,19 +36,19 @@ public class JapaneseAnalyzer : StopwordAnalyzerBase |
36 | 36 | { |
37 | 37 | private readonly JapaneseTokenizerMode mode; |
38 | 38 | private readonly ISet<string> stoptags; |
39 | | - private readonly UserDictionary userDict; |
| 39 | + private readonly UserDictionary? userDict; |
40 | 40 |
|
41 | 41 | public JapaneseAnalyzer(LuceneVersion matchVersion) |
42 | 42 | : this(matchVersion, null, JapaneseTokenizer.DEFAULT_MODE, DefaultSetHolder.DEFAULT_STOP_SET, DefaultSetHolder.DEFAULT_STOP_TAGS) |
43 | 43 | { |
44 | 44 | } |
45 | 45 |
|
46 | | - public JapaneseAnalyzer(LuceneVersion matchVersion, UserDictionary userDict, JapaneseTokenizerMode mode, CharArraySet stopwords, ISet<string> stoptags) |
| 46 | + public JapaneseAnalyzer(LuceneVersion matchVersion, UserDictionary? userDict, JapaneseTokenizerMode mode, CharArraySet stopwords, ISet<string> stoptags) |
47 | 47 | : base(matchVersion, stopwords) |
48 | 48 | { |
49 | 49 | this.userDict = userDict; |
50 | 50 | this.mode = mode; |
51 | | - this.stoptags = stoptags; |
| 51 | + this.stoptags = stoptags ?? throw new ArgumentNullException(nameof(stoptags)); |
52 | 52 | } |
53 | 53 |
|
54 | 54 | [Obsolete("Use DefaultStopSet instead. This method will be removed in 4.8.0 release candidate."), System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] |
|
0 commit comments