コード例 #1
0
void indri::infnet::ContextSimpleCountAccumulator::_computeCounts( indri::index::Index& index ) {
  _size += index.termCount();
  _documentCount += index.documentCount();
  _documentOccurrences += index.documentCount( _term );
  if( _term.length() != 0 ) {
    _occurrences += index.termCount( _term );
  }
}
コード例 #2
0
void indri::infnet::ContextSimpleCountAccumulator::_computeCounts( indri::index::Index& index ) {
  assert( _terms.size() );
  assert( _context.size() == 0 || _field.size() == 0 );

  if( _context.size() ) {
    _size += index.fieldTermCount( _context );
  } else {
    _size += index.termCount();
  }

  for( unsigned int i=0; i<_terms.size(); i++ ) {
    if( _terms[i].length() != 0 ) {
      if( _field.size() ) {
        _occurrences += index.fieldTermCount( _field, _terms[i] );
      } else if( _context.size() ) {
        _occurrences += index.fieldTermCount( _context, _terms[i] );
      } else {
        _occurrences += index.termCount( _terms[i] );
      }
    }
  }
}
コード例 #3
0
void indri::infnet::ContextCountAccumulator::indexChanged( indri::index::Index& index ) {
  if( ! _context ) {
    _contextSize += index.termCount();
  }
  _documentCount += index.documentCount();
}