[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/nepomuk-kde/annotation/plugins/scribo
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2009-09-17 9:49:13
Message-ID: 1253180953.166238.24598.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1024829 by trueg:

For the time being we do not use the TextAnnotation but annotate directly since we do \
not show the text annotations properly anywhere yet

 M  +23 -0     scriboannotationplugin.cpp  


--- trunk/playground/base/nepomuk-kde/annotation/plugins/scribo/scriboannotationplugin.cpp \
#1024828:1024829 @@ -172,6 +172,7 @@
             }
 
             if ( !haveTag ) {
+#ifdef WE_DISABLE_THE_LINKING_TO_TEXT_PARTS_UNTIL_NIE_HASPART_IS_SUPPORTED_EVERYWHERE
  // FIXME: support all occurrences
                 Nepomuk::StackedPimoTextAnnotation* anno = new \
                Nepomuk::StackedPimoTextAnnotation();
                 anno->setChildAnnotation( new TagAnnotation( entity.label() ) );
@@ -180,6 +181,11 @@
                 anno->setTextExcerpt( match.label() );
                 anno->setRelevance( 0.5*match.occurrences().first().relevance() ); \
// FIXME: this is awful  addNewAnnotation( anno );
+#else
+                Nepomuk::TagAnnotation* anno = new Nepomuk::TagAnnotation( \
entity.label() ); +                anno->setRelevance( \
0.5*match.occurrences().first().relevance() ); // FIXME: this is awful +              \
addNewAnnotation(anno); +#endif
             }
         }
     }
@@ -192,6 +198,7 @@
     QString label = res.genericLabel();
     double relevance = entity.occurrences().first().relevance();
 
+#ifdef WE_DISABLE_THE_LINKING_TO_TEXT_PARTS_UNTIL_NIE_HASPART_IS_SUPPORTED_EVERYWHERE
  Nepomuk::StackedTextAnnotation* anno = 0;
     if ( type == Soprano::Vocabulary::NAO::Tag() ) {
         anno = new Nepomuk::StackedPimoTextAnnotation();
@@ -216,6 +223,22 @@
         anno->setTextExcerpt( entity.label() );
         addNewAnnotation( anno );
     }
+#else
+    if ( type == Soprano::Vocabulary::NAO::Tag() ) {
+        Nepomuk::TagAnnotation* anno = new Nepomuk::TagAnnotation( \
res.genericLabel() ); +        anno->setRelevance( score * relevance /*1.0/( double \
)pos*/ ); // FIXME: this is awful +        addNewAnnotation( anno );
+    }
+    else {
+        Nepomuk::SimplePimoAnnotation* anno = new Nepomuk::SimplePimoAnnotation( \
Nepomuk::Vocabulary::PIMO::isRelated(), res ); +        Nepomuk::Types::Class \
typeClass( type ); +        anno->setLabel( label );
+        anno->setComment( i18n( "Mentions '%1' (%2)", label, typeClass.label() ) );
+        anno->setIcon( KIcon( "nepomuk" ) );
+        anno->setRelevance( score * relevance /*1.0/( double )pos*/ ); // FIXME: \
this is awful +        addNewAnnotation(anno);
+    }
+#endif
 }
 
 NEPOMUK_EXPORT_ANNOTATION_PLUGIN( Nepomuk::ScriboAnnotationPlugin, \
"nepomuk_scriboannotationplugin" )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic