You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/02/17 12:03:38 UTC

[GitHub] [lucene-solr] rmuir commented on a change in pull request #1262: LUCENE-9220: regenerate all stemmers/stopwords/test data from snowball 2.0

rmuir commented on a change in pull request #1262: LUCENE-9220: regenerate all stemmers/stopwords/test data from snowball 2.0
URL: https://github.com/apache/lucene-solr/pull/1262#discussion_r380143193
 
 

 ##########
 File path: gradle/generation/snowball.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: "de.undercouch.download"
+
+configure(rootProject) {
+  ext {
+    snowballWorkDir    = file("${buildDir}/snowball")
+    snowballStemmerDir = file("${buildDir}/snowball/stemmers")
+    snowballPatchedDir = file("${buildDir}/snowball/patched")
+    snowballWebsiteDir = file("${buildDir}/snowball/website")
+    snowballDataDir    = file("${buildDir}/snowball/data")
+  }
+
+  task snowball()  {
+    description "Regenerate snowball-based sources, stopwords, and tests for ...lucene/analysis."
+    group "generation"
+
+    dependsOn ":lucene:analysis:common:snowballGen"
+  }
+
+  task downloadSnowballStemmers(type: Download) {
+    def stemmerZip = file("${snowballWorkDir}/stemmers.zip")
+
+    src "https://github.com/snowballstem/snowball/archive/53739a805cfa6c77ff8496dc711dc1c106d987c1.zip"
+    dest stemmerZip
+    onlyIfModified true
+    useETag "all"
+    cachedETagsFile file("${snowballWorkDir}/stemmers.json")
+
+    doLast {
+      ant.unzip(src: stemmerZip, dest: snowballStemmerDir, overwrite: "true") {
+        ant.cutdirsmapper(dirs: "1")
+      }
+    }
+  }
+
+  task downloadSnowballWebsite(type: Download) {
+    def websiteZip = file("${snowballWorkDir}/website.zip")
+
+    src "https://github.com/snowballstem/snowball-website/archive/ff891e74f08e7315523ee3c0cad55bb1b7831b9d.zip"
+    dest websiteZip
+    onlyIfModified true
+    useETag "all"
+    cachedETagsFile file("${snowballWorkDir}/website.json")
+
+    doLast {
+      ant.unzip(src: websiteZip, dest: snowballWebsiteDir, overwrite: "true") {
+        ant.cutdirsmapper(dirs: "1")
+      }
+    }
+  }
+
+  task downloadSnowballData(type: Download) {
+    def dataZip = file("${snowballWorkDir}/data.zip")
+
+    src "https://github.com/snowballstem/snowball-data/archive/9145f8732ec952c8a3d1066be251da198a8bc792.zip"
+    dest dataZip
+    onlyIfModified true
+    useETag "all"
+    cachedETagsFile file("${snowballWorkDir}/data.json")
+
+    doLast {
+      ant.unzip(src: dataZip, dest: snowballDataDir, overwrite: "true") {
+        ant.cutdirsmapper(dirs: "1")
+      }
+    }
+  }
+
+  task cleanSnowballCheckout(type: Delete) {
 
 Review comment:
   yeah mainly i'm after two things:
   * don't download stuff if you have downloaded it before (uses ETag check). Some files are quite large.
   * before patching, make a clean copy of checkout. This way we don't ever try to apply patch twice and don't force downloading again.
   
   We can change to a doFirst I think. Lemme try.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org