You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by ma...@apache.org on 2014/03/05 15:24:17 UTC

svn commit: r1574504 - in /opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker: BaseLink.java EntityLinkerFactory.java EntityLinkerProperties.java LinkedSpan.java

Author: markg
Date: Wed Mar  5 14:24:16 2014
New Revision: 1574504

URL: http://svn.apache.org/r1574504
Log:
OPENNLP-630
Minor changes to the toString() in linkedspan and baselink to be more friendly to the cli tool (and others). Changed Javadoc in entitylinker properties

Modified:
    opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/BaseLink.java
    opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java
    opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerProperties.java
    opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java

Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/BaseLink.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/BaseLink.java?rev=1574504&r1=1574503&r2=1574504&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/BaseLink.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/BaseLink.java Wed Mar  5 14:24:16 2014
@@ -122,7 +122,7 @@ public abstract class BaseLink {
 
   @Override
   public String toString() {
-    return "BaseLink{\n" + "\nitemParentID=" + itemParentID + ", \nitemID=" + itemID + ", \nitemName=" + itemName + ", \nitemType=" + itemType + ", \nscoreMap=" + scoreMap + "\n}";
+    return "\tBaseLink" + "\n\titemParentID=" + itemParentID + ", \n\titemID=" + itemID + ", \n\titemName=" + itemName + ", \n\titemType=" + itemType + ", \n\tscoreMap=" + scoreMap + "\n";
   }
 
   @Override

Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java?rev=1574504&r1=1574503&r2=1574504&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerFactory.java Wed Mar  5 14:24:16 2014
@@ -25,7 +25,7 @@ public class EntityLinkerFactory {
 
   /**
    *
-   * @param <I>        A type that extends EntityLinkerProperties.
+
    * @param entityType The type of entity being linked to. This value is used to
    *                   retrieve the implementation of the entitylinker from the
    *                   entitylinker properties file.
@@ -41,7 +41,7 @@ public class EntityLinkerFactory {
     
     String linkerImplFullName = properties.getProperty("linker." + entityType, "");
     
-    if (linkerImplFullName == null) {
+    if (linkerImplFullName == null || linkerImplFullName.equals("")) {
       throw new IllegalArgumentException("linker." + entityType + "  property must be set!");
     }
     

Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerProperties.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerProperties.java?rev=1574504&r1=1574503&r2=1574504&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerProperties.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/EntityLinkerProperties.java Wed Mar  5 14:24:16 2014
@@ -49,7 +49,7 @@ public class EntityLinkerProperties {
 
   /**
    *
-   * @param propertiesfile inputstream of properties file. Stream will not be
+   * @param propertiesIn inputstream of properties file. Stream will not be
    *                       closed
    * @throws IOException
    *

Modified: opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java?rev=1574504&r1=1574503&r2=1574504&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java (original)
+++ opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/entitylinker/LinkedSpan.java Wed Mar  5 14:24:16 2014
@@ -107,7 +107,7 @@ public class LinkedSpan<T extends BaseLi
 
   @Override
   public String toString() {
-    return "LinkedSpan{\n\tsentenceid=" + sentenceid + ", \n\tsearchTerm=" + searchTerm + "\n\tlinkedEntries=\n" + linkedEntries + "\n}";
+    return "LinkedSpan\nsentenceid=" + sentenceid + "\nsearchTerm=" + searchTerm + "\nlinkedEntries=\n" + linkedEntries + "\n";
   }
 
   @Override