Author: rwesten
Date: Mon Sep 23 10:34:34 2013
New Revision: 1525546

URL: http://svn.apache.org/r1525546
Log:
STANBOL-760: Corrected a bug that prevented the configuration of 'write phrase 
sentiments' and 'write sentence sentiments' options; Document sentiments now do 
use the dc:type fise:DocumentSentiment. This allows to query for those without 
searcing for sentiments without fise:start and fise:end values

Modified:
    
stanbol/trunk/enhancement-engines/sentiment-summarization/src/main/java/org/apache/stanbol/enhancer/engines/sentiment/summarize/SentimentSummarizationEngine.java

Modified: 
stanbol/trunk/enhancement-engines/sentiment-summarization/src/main/java/org/apache/stanbol/enhancer/engines/sentiment/summarize/SentimentSummarizationEngine.java
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/sentiment-summarization/src/main/java/org/apache/stanbol/enhancer/engines/sentiment/summarize/SentimentSummarizationEngine.java?rev=1525546&r1=1525545&r2=1525546&view=diff
==============================================================================
--- 
stanbol/trunk/enhancement-engines/sentiment-summarization/src/main/java/org/apache/stanbol/enhancer/engines/sentiment/summarize/SentimentSummarizationEngine.java
 (original)
+++ 
stanbol/trunk/enhancement-engines/sentiment-summarization/src/main/java/org/apache/stanbol/enhancer/engines/sentiment/summarize/SentimentSummarizationEngine.java
 Mon Sep 23 10:34:34 2013
@@ -142,6 +142,10 @@ public class SentimentSummarizationEngin
      * The dc:type value used for fise:TextAnnotations indicating a Sentiment
      */
     public static final UriRef SENTIMENT_TYPE = new 
UriRef(NamespaceEnum.fise+"Sentiment");
+    /**
+     * The dc:Type value sued for the sentiment annotation of the whole 
document
+     */
+    public static final UriRef DOCUMENT_SENTIMENT_TYPE = new 
UriRef(NamespaceEnum.fise+"DocumentSentiment");
 
 
     private static final int DEFAULT_NEGATION_CONTEXT = 2;
@@ -194,12 +198,12 @@ public class SentimentSummarizationEngin
                 Boolean.parseBoolean(value.toString());
         //should we write sentiment values for sentences
         value = ctx.getProperties().get(PROPERTY_SENTENCE_SENTIMENT_STATE);
-        this.writeDocumentSentiment = value == null ? 
DEFAULT_SENTENCE_SENTIMENT_STATE :
+        this.writeSentencesSentimet = value == null ? 
DEFAULT_SENTENCE_SENTIMENT_STATE :
             value instanceof Boolean ? ((Boolean)value).booleanValue() : 
                 Boolean.parseBoolean(value.toString());
         //should we write sentiment values for phrases
         value = ctx.getProperties().get(PROPERTY_PHRASE_SENTIMENT_STATE);
-        this.writeDocumentSentiment = value == null ? 
DEFAULT_PHRASE_SENTIMENT_STATE :
+        this.writeSentimentPhrases = value == null ? 
DEFAULT_PHRASE_SENTIMENT_STATE :
             value instanceof Boolean ? ((Boolean)value).booleanValue() : 
                 Boolean.parseBoolean(value.toString());
     }
@@ -714,6 +718,10 @@ public class SentimentSummarizationEngin
         if(ssoType != null){
             metadata.add(new TripleImpl(enh, DC_TYPE, ssoType));
         }
+        if(section.getType() == SpanTypeEnum.Text){
+            metadata.add(new TripleImpl(enh, DC_TYPE, 
DOCUMENT_SENTIMENT_TYPE));
+        }
+        
     }
     /**
      * The maximum size of the preix/suffix for the selection context


Reply via email to