apache / apache/lucene

Set parent class of DutchAnalyzer to StopwordAnalyzerBase [LUCENE-8582]

Open
#9,628 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major module:analysis type:task
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

Currently the parent class of DutchAnalyzer is **Analyzer**.

And I saw the comment

```java
// TODO: extend StopwordAnalyzerBase
```

in DutchAnalyzer.

 

So I changed the code as follows.

```java
public final class DutchAnalyzer extends StopwordAnalyzerBase {
...
 
// This instance is no longer necessary.
  // private final CharArraySet stoptable;

public DutchAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionTable, CharArrayMap stemOverrideDict) {
super(stopwords); // Use StopwordAnalyzerBase's constructor to set stopwords.
...
}
...
`@Override`
protected TokenStreamComponents createComponents(String fieldName) {
...
result = new StopFilter(result, stopwords); // Use StopwordAnalyzerBase's instance
...
}
...
}
```

---
Migrated from [LUCENE-8582](https://issues.apache.org/jira/browse/LUCENE-8582) by Namgyu Kim (@danmuzi), updated Dec 10 2018
Attachments: [LUCENE-8582.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-8582/LUCENE-8582.patch)

Contributor guide

Open the contributing guide

Research direction

Start with DutchAnalyzer and inspect the TODO comment about extending StopwordAnalyzerBase, then review the attached LUCENE-8582.patch for the proposed scope. Done means DutchAnalyzer uses the intended parent class and its stopword handling remains correct; identify the relevant analyzer tests before making changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.