help-gift
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Re: [help-GIFT] GIFT Compilation stuff


From: Wolfgang Müller
Subject: Fwd: Re: [help-GIFT] GIFT Compilation stuff
Date: Mon, 22 Jul 2002 10:47:25 +0200

Re-hi,
this might be interesting for some people. In particular, this is one 
extension of the MRML which was quite ad-hoc and quite GIFT-dependent, and 
thus has stayed undocumented for quite a while.
Cheers,
Wolfgang

----------  Weitergeleitete Nachricht  ----------

Subject: Re: [help-GIFT] GIFT Compilation stuff
Date: Mon, 22 Jul 2002 10:34:56 +0200
From: Wolfgang Müller <address@hidden>
To: KOSINOV Serhiy <address@hidden>

Am Sonntag, 21. Juli 2002 19:51 schrieben Sie:
> Wolfgang Müller wrote:
> > Yes, 2.8.1 is too old. 2.95 should work decently, what I use for
> > development now is 3.1. Things should compile with 2.95 though, as 3.1.
> > is more picky. Wolfgang
>
> Oh, by the way, Wolfgang, if I want to query a collection with a certain
> number of features without having an example image for that purpose
> (i.e. querying with a feature vector as opposed to "QBE'ing", so to say
>
> :-), can it in any way be done with what's already implemented in
>
> MRML/GIFT?

I once did that. The code should be in CQInvertedFile.cc within the fastQuery
method. Ah, yes, see the code snipped below, it's exactly there. So, if you
want to use that feature, simply write a small MRML client that issues
queries for a given feature. This means. The query-step tag containing
something like

<cui-inverted-file-query-by-feature>
<cui-term-frequency-element feature-id="2" term-frequency="0.27"/>
<cui-term-frequency-element feature-id="125" term-frequency="1"/>
</cui-inverted-file-query-by-feature>

would give you the query result for these two features.

> Or, should I start deriving my stuff from CQuery/CAccessor?

If you derive anything it would be rather CQuery, as the underlying index
structure stays the same.

Cheers,
Wolfgang

(SOME STUFF SNIPPED)

--taken from CQInvertedFile.cc fastQuery()
...
    if((*i)->getName()=="cui-inverted-file-query-by-feature"){
      for(list<CXMLElement*>::const_iterator j=(*i)->child_list_begin();
          j!=(*i)->child_list_end();
          j++){
        if((*j)->getName()=="cui-term-frequency-element"){
          pair<bool,int> lFeatureID((*j)->longReadAttribute("feature-id"));
          pair<bool,double>
lTermFrequency((*j)->doubleReadAttribute("term-frequency"));

          if(lFeatureID.first){
            if(lTermFrequency.first){

mQueryFeatureWeighters->addFeature(lTermFrequency.second,CDocumentFrequencyEl
ement(lFeatureID.second, 1));
            }else{

mQueryFeatureWeighters->addFeature(1,CDocumentFrequencyElement(lFeatureID.sec
ond, 1));
            }
          }
        }
      }
    }
...

-------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]