You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by og...@apache.org on 2011/03/04 14:54:46 UTC

svn commit: r1077948 - /incubator/stanbol/trunk/enhancer/engines/autotagging/src/main/java/org/apache/stanbol/enhancer/engines/autotagging/impl/EntityMentionEnhancementEngine.java

Author: ogrisel
Date: Fri Mar  4 13:54:46 2011
New Revision: 1077948

URL: http://svn.apache.org/viewvc?rev=1077948&view=rev
Log:
STANBOL-109: Make EntityMentionEngine able to resolve entities without a selection context

Modified:
    incubator/stanbol/trunk/enhancer/engines/autotagging/src/main/java/org/apache/stanbol/enhancer/engines/autotagging/impl/EntityMentionEnhancementEngine.java

Modified: incubator/stanbol/trunk/enhancer/engines/autotagging/src/main/java/org/apache/stanbol/enhancer/engines/autotagging/impl/EntityMentionEnhancementEngine.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/autotagging/src/main/java/org/apache/stanbol/enhancer/engines/autotagging/impl/EntityMentionEnhancementEngine.java?rev=1077948&r1=1077947&r2=1077948&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/autotagging/src/main/java/org/apache/stanbol/enhancer/engines/autotagging/impl/EntityMentionEnhancementEngine.java (original)
+++ incubator/stanbol/trunk/enhancer/engines/autotagging/src/main/java/org/apache/stanbol/enhancer/engines/autotagging/impl/EntityMentionEnhancementEngine.java Fri Mar  4 13:54:46 2011
@@ -125,10 +125,7 @@ public class EntityMentionEnhancementEng
         String context = EnhancementEngineHelper.getString(graph,
                 textAnnotation, ENHANCER_SELECTION_CONTEXT);
         if (context == null) {
-            log.warn("Unable to process TextAnnotation " + textAnnotation
-                    + " because property" + ENHANCER_SELECTION_CONTEXT
-                    + " is not present");
-            return Collections.emptyList();
+            context = "";
         }
 
         // aggregate context from subsumed entries:
@@ -152,8 +149,8 @@ public class EntityMentionEnhancementEng
         log.debug("Process TextAnnotation " + name + " type=" + type);
 
         // this is a name lookup + context for disambiguation.
-        List<TagInfo> matchingEntities = autotagger.suggestForType(name,
-                context, type.getUnicodeString());
+        List<TagInfo> matchingEntities = autotagger.suggestForType(name, context.trim(),
+            type.getUnicodeString());
 
         List<NonLiteral> annotationsToRelate = new ArrayList<NonLiteral>();
         annotationsToRelate.add(textAnnotation);