[ 
https://issues.apache.org/jira/browse/OPENNLP-1318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17243479#comment-17243479
 ] 

ASF GitHub Bot commented on OPENNLP-1318:
-----------------------------------------

kinow commented on a change in pull request #383:
URL: https://github.com/apache/opennlp/pull/383#discussion_r535542824



##########
File path: 
opennlp-tools/src/test/java/opennlp/tools/namefind/NameFinderMETest.java
##########
@@ -109,6 +110,21 @@ public void testNameFinder() throws Exception {
     Assert.assertEquals(new Span(4, 6, DEFAULT), names[1]);
   }
 
+  @Test
+  public void testNameFinderWithDownloadedModel() throws Exception {
+
+    String input = "Pierre Vinken , 61 years old , will join the board as a 
nonexecutive director Nov. 29 .";
+    String[] sentence = input.split(" ");
+
+    TokenNameFinder nameFinder = new NameFinderME("en", 
DownloadUtil.EntityType.PERSON);

Review comment:
       I wonder if some of these tests could become flaky if there are internet 
connection issues in the client or the server side?

##########
File path: opennlp-tools/src/main/java/opennlp/tools/util/DownloadUtil.java
##########
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+
+package opennlp.tools.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+
+import opennlp.tools.chunker.ChunkerModel;
+import opennlp.tools.namefind.TokenNameFinderModel;
+import opennlp.tools.sentdetect.SentenceModel;
+import opennlp.tools.tokenize.TokenizerModel;
+import opennlp.tools.util.model.BaseModel;
+
+public class DownloadUtil {

Review comment:
       I came looking at this class to check where the models were downloaded 
from, and to which folder on my computer. Maybe we could add a short Javadoc 
here, saying the models are downloaded from SourceForge, and are put in the 
`$USER/.opennlp` folder?




----------------------------------------------------------------
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:
[email protected]


> Add ability to download models from within OpenNLP
> --------------------------------------------------
>
>                 Key: OPENNLP-1318
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1318
>             Project: OpenNLP
>          Issue Type: Task
>            Reporter: Jeffrey T. Zemerick
>            Assignee: Jeffrey T. Zemerick
>            Priority: Major
>
> Add ability to download models from within OpenNLP.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to