Hello community, here is the log from the commit of package languagetool for openSUSE:Factory checked in at 2020-04-08 19:55:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/languagetool (Old) and /work/SRC/openSUSE:Factory/.languagetool.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "languagetool" Wed Apr 8 19:55:33 2020 rev:2 rq:791949 version:4.8 Changes: -------- --- /work/SRC/openSUSE:Factory/languagetool/languagetool-core.changes 2020-04-07 10:28:02.762277758 +0200 +++ /work/SRC/openSUSE:Factory/.languagetool.new.3248/languagetool-core.changes 2020-04-08 19:55:35.657075645 +0200 @@ -1,0 +2,8 @@ +Tue Apr 7 09:42:59 UTC 2020 - Fridrich Strba <fst...@suse.com> + +- Added patch: + * languagetool-4.8-lucene-8.patch + + Port to lucene >= 8 + + Apply only if building with lucene >= 8 + +------------------------------------------------------------------- languagetool-tools.changes: same change languagetool.changes: same change New: ---- languagetool-4.8-lucene-8.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ languagetool-core.spec ++++++ --- /var/tmp/diff_new_pack.66nfmv/_old 2020-04-08 19:55:37.993077351 +0200 +++ /var/tmp/diff_new_pack.66nfmv/_new 2020-04-08 19:55:37.993077351 +0200 @@ -31,6 +31,7 @@ Patch0: languagetool-descriptor.patch Patch1: languagetool-xgboost-predictor.patch Patch2: languagetool-hunspell.patch +Patch3: languagetool-4.8-lucene-8.patch BuildRequires: fdupes BuildRequires: hunspell-devel BuildRequires: maven-local @@ -65,6 +66,8 @@ BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) BuildRequires: mvn(tech.units:indriya) %requires_eq %{hunspell_library} +%requires_ge lucene-backward-codecs +%requires_ge lucene-core BuildArch: noarch %description @@ -89,6 +92,9 @@ %patch0 -p1 %patch1 -p1 %patch2 -p1 +%if %{?pkg_vcmp:%pkg_vcmp lucene-core >= 8}%{!?pkg_vcmp:0} +%patch3 -p1 +%endif cat %{SOURCE100} | sed "s#@LIBHUNSPELL@#$(basename $(readlink -e %{_libdir}/libhunspell.so))#g" | patch -p1 ++++++ languagetool-tools.spec ++++++ --- /var/tmp/diff_new_pack.66nfmv/_old 2020-04-08 19:55:38.009077363 +0200 +++ /var/tmp/diff_new_pack.66nfmv/_new 2020-04-08 19:55:38.013077366 +0200 @@ -28,6 +28,7 @@ Patch0: languagetool-descriptor.patch Patch1: languagetool-xgboost-predictor.patch Patch2: languagetool-hunspell.patch +Patch3: languagetool-4.8-lucene-8.patch BuildRequires: fdupes BuildRequires: maven-local BuildRequires: mvn(commons-cli:commons-cli) @@ -52,6 +53,9 @@ %patch0 -p1 %patch1 -p1 %patch2 -p1 +%if %{?pkg_vcmp:%pkg_vcmp lucene-core >= 8}%{!?pkg_vcmp:0} +%patch3 -p1 +%endif pushd %{name} %{mvn_file} :{*} %{base_name}/@1 ++++++ languagetool.spec ++++++ --- /var/tmp/diff_new_pack.66nfmv/_old 2020-04-08 19:55:38.029077378 +0200 +++ /var/tmp/diff_new_pack.66nfmv/_new 2020-04-08 19:55:38.029077378 +0200 @@ -27,6 +27,7 @@ Patch0: languagetool-descriptor.patch Patch1: languagetool-xgboost-predictor.patch Patch2: languagetool-hunspell.patch +Patch3: languagetool-4.8-lucene-8.patch BuildRequires: fdupes BuildRequires: maven-local BuildRequires: xmvn-subst @@ -103,8 +104,6 @@ Requires: languagetool-libs = %{version}-%{release} Requires: languagetool-tools Requires: logback -Requires: lucene-backward-codecs -Requires: lucene-core Requires: mariadb-java-client Requires: minlog Requires: morfologik-stemming @@ -133,6 +132,8 @@ Requires: uom-lib-common Requires: xgboost Requires: xgboost-predictor +%requires_ge lucene-backward-codecs +%requires_ge lucene-core %description LanguageTool is a free and open-source grammar checker. @@ -159,6 +160,9 @@ %patch0 -p1 %patch1 -p1 %patch2 -p1 +%if %{?pkg_vcmp:%pkg_vcmp lucene-core >= 8}%{!?pkg_vcmp:0} +%patch3 -p1 +%endif # We built these ones in another spec file %pom_disable_module languagetool-core ++++++ languagetool-4.8-lucene-8.patch ++++++ diff -urEbwB languagetool-4.8/languagetool-core/src/main/java/org/languagetool/languagemodel/LuceneSingleIndexLanguageModel.java languagetool-4.8.new/languagetool-core/src/main/java/org/languagetool/languagemodel/LuceneSingleIndexLanguageModel.java --- languagetool-4.8/languagetool-core/src/main/java/org/languagetool/languagemodel/LuceneSingleIndexLanguageModel.java 2019-12-27 11:17:28.000000000 +0100 +++ languagetool-4.8.new/languagetool-core/src/main/java/org/languagetool/languagemodel/LuceneSingleIndexLanguageModel.java 2020-04-06 19:30:06.188433021 +0200 @@ -147,10 +147,10 @@ try { RegexpQuery query = new RegexpQuery(new Term("totalTokenCount", ".*")); TopDocs docs = luceneSearcher.searcher.search(query, 1000); // Integer.MAX_VALUE might cause OOE on wrong index - if (docs.totalHits == 0) { + if (docs.totalHits.value == 0) { throw new RuntimeException("Expected 'totalTokenCount' meta documents not found in 1grams index: " + luceneSearcher.directory); - } else if (docs.totalHits > 1000) { - throw new RuntimeException("Did not expect more than 1000 'totalTokenCount' meta documents: " + docs.totalHits + " in " + luceneSearcher.directory); + } else if (docs.totalHits.value > 1000) { + throw new RuntimeException("Did not expect more than 1000 'totalTokenCount' meta documents: " + docs.totalHits.value + " in " + luceneSearcher.directory); } else { long result = 0; for (ScoreDoc scoreDoc : docs.scoreDocs) { @@ -195,9 +195,9 @@ long result = 0; try { TopDocs docs = luceneSearcher.searcher.search(new TermQuery(term), 2000); - if (docs.totalHits > 2000) { + if (docs.totalHits.value > 2000) { throw new RuntimeException("More than 2000 matches for '" + term + "' not supported for performance reasons: " + - docs.totalHits + " matches in " + luceneSearcher.directory); + docs.totalHits.value + " matches in " + luceneSearcher.directory); } for (ScoreDoc scoreDoc : docs.scoreDocs) { String countStr = luceneSearcher.reader.document(scoreDoc.doc).get("count"); diff -urEbwB languagetool-4.8/languagetool-standalone/src/main/java/org/languagetool/dev/HomophoneOccurrenceDumper.java languagetool-4.8.new/languagetool-standalone/src/main/java/org/languagetool/dev/HomophoneOccurrenceDumper.java --- languagetool-4.8/languagetool-standalone/src/main/java/org/languagetool/dev/HomophoneOccurrenceDumper.java 2019-12-27 11:17:28.000000000 +0100 +++ languagetool-4.8.new/languagetool-standalone/src/main/java/org/languagetool/dev/HomophoneOccurrenceDumper.java 2020-04-06 21:13:30.697861690 +0200 @@ -19,7 +19,7 @@ package org.languagetool.dev; import org.apache.lucene.index.Fields; -import org.apache.lucene.index.MultiFields; +import org.apache.lucene.index.MultiTerms; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.util.BytesRef; @@ -111,8 +111,7 @@ private TermsEnum getIterator() throws IOException { LuceneSearcher luceneSearcher = getLuceneSearcher(3); - Fields fields = MultiFields.getFields(luceneSearcher.getReader()); - Terms terms = fields.terms("ngram"); + Terms terms = MultiTerms.getTerms(luceneSearcher.getReader(), "ngram"); return terms.iterator(); }