Apache Solr open-source search software
LUCENE-1966: ArabicAnalyzer stopwords cleanup
Robert Muire053d8045509
diff --git a/contrib/CHANGES.txt b/contrib/CHANGES.txtindex 9b5db8efa51..d941b6d3515 100644--- a/contrib/CHANGES.txt+++ b/contrib/CHANGES.txt@@ -10,6 +10,10 @@ Changes in backwards compatibility policyChanges in runtime behavior+ * LUCENE-1966: Modified and cleaned the default Arabic stopwords list used+ by ArabicAnalyzer. You'll need to fully re-index any previously created+ indexes. (Basem Narmok via Robert Muir)+* LUCENE-1963: ArabicAnalyzer now lowercases before checking the stopwordlist. This has no effect on Arabic text, but if you are using a customstopword list that contains some non-Arabic words, you'll need to fullydiff --git a/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicAnalyzer.java b/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicAnalyzer.javaindex b5c1d57a2f7..00a96e419b0 100644--- a/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicAnalyzer.java+++ b/contrib/analyzers/common/src/java/org/apache/lucene/analysis/ar/ArabicAnalyzer.java@@ -148,6 +148,7 @@ public final class ArabicAnalyzer extends Analyzer {public final TokenStream tokenStream(String fieldName, Reader reader) {TokenStream result = new ArabicLetterTokenizer( reader );result = new LowerCaseFilter(result);+ // the order here is important: the stopword list is not normalized!result = new StopFilter( result, stoptable );result = new ArabicNormalizationFilter( result );result = new ArabicStemFilter( result );@@ -175,6 +176,7 @@ public final class ArabicAnalyzer extends Analyzer {streams = new SavedStreams();streams.source = new ArabicLetterTokenizer(reader);streams.result = new LowerCaseFilter(streams.source);+ // the order here is important: the stopword list is not normalized!streams.result = new StopFilter(streams.result, stoptable);streams.result = new ArabicNormalizationFilter(streams.result);streams.result = new ArabicStemFilter(streams.result);diff --git a/contrib/analyzers/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txt b/contrib/analyzers/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txtindex 13d14671a92..21897849280 100644--- a/contrib/analyzers/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txt+++ b/contrib/analyzers/common/src/resources/org/apache/lucene/analysis/ar/stopwords.txt@@ -1,161 +1,123 @@# This file was created by Jacques Savoy and is distributed under the BSD license.# See http://members.unine.ch/jacques.savoy/clef/index.html.# Also see http://www.opensource.org/licenses/bsd-license.html+# Cleaned on October 11, 2009 (not normalized, so use before normalization)+من+ومن+منها+منه+في+وفي+فيها+فيه+و+ف+ثم+او+أوب+بها+بهاأ-،-عبد-عدم-عام-عاما+اى+اي+أي+أى+لا+ولا+الا+ألا+إلا+لكن+ما+وما+كما+فماعن-عند-عندما-على-عليه-عليها-تم-ضد-بعد-بعض-اعادة-اعلن-اعلنت-بسبب-حتى-اتفاق+معاذا-احد-اثر-اجتماع-اطار-اربعة-اخرى-بان-ابو-اجل-غير-اطلاق-بشكل-حاليا-بن-به-ثم-اف+إذاان-او-اي-بها-جهة-حيث-اكد-الا-اما-العام-السابق-السلام-التعاون+أن+إن+انها+أنها+إنها+انه+أنه+إنه+بان+بأن+فان+فأن+وان+وأن+وإنالتىالتي-اكثر-ايضا-الذاتي-الاخيرة-الثاني-الثانيةالذىالذي-الان-خلال-حوالىالذين-الحكم-الاول-الاولى-بين-ذلكالى-انه-ضمن-انها-جميع-الماضي-المقبل-ف-و-و6-قد-لا-ما-مع-هذا-واضاف-واضافت-فان-قبل-كان-لدى-نحو-هذه-وان-يذكر-كانت-واوضح-فى-في+الي+إلى+إلي+على+عليها+عليه+اما+أما+إما+ايضا+أيضاكل+وكللم+ولملن-له-من-هو+ولن+هىهي-كما+هو+وهى+وهي+وهو+فهى+فهي+فهو+انت+أنت+لكلها-منذ-ولا-مقابل+له+هذه+هذا+تلك+ذلكهناك-وكان-وكانت-فيه-لكن-وفي-ولم-ومن-وهو-وهي-فيها-منها+كانت+كانيكون-أخرى-إذا-أربعة-إطار-إعادة-أعلن-أعلنت-أف-أكثر-أكد-إلا-الأخيرة+تكون+وكانت+وكان+غير+بعض+قد+نحو+بين+بينما+منذ+ضمن+حيث+الانالآن-الأول-الأولى-إلى-أما-أن-إن-إنه-أنه-أنها-إنها-أو-اى-أي-أى-أيضا-بأن-فإن+خلال+بعد+قبل+حتى+عند+عندما+لدى+جميع