++




- 4


word.erase( pos3+2 );

// "'s"

if ( word[ pos3+l ] == '\'' )

word.erase( pos3+l );

}

void

TextQuery::

strip_caps()

{

vector<string,allocator> *words = text_locations->first;

vector<string,allocator>::iterator iter = words->begin();

vector<string,allocator>::iterator iter_end = words->end();

string caps( "ABCDEFGHI3KLMNOPQRSTUVWXYZ" );

while ( iter != iter_end ) {

string::size_type pos = 0;

while (( pos = (*iter).find_first_of( caps, pos ))

!= string::npos )

(*iter)[ pos ] = to1ower( (*iter)[pos] );

++iter;

}

}

void

TextQuery::

build_word_map()

{

word_map = new map<string,loc*,less<string>,allocator>;

typedef map<string,loc*,less<string>,allocator>::value_type

value_type;

typedef set<string,less<string>,allocator>::difference_type

diff_type;

set<string,less<string>,allocator> exclusion_set;

ifstream infile( "exclusion_set" );

if ( !infile )

{

static string default_excluded_words[25] = {

"the","and","but","that","then","are","been",

"can","can't","cannot","could","did","for",

"had","have","him","his","her","its"."into",

"were","which","when","with","would"

};

cerr <<

"warning! unable to open word exclusion file! -- "

<< "using default set\n";

copy( default_excluded_words,

default_excluded_words+25,

inserter(exclusion_set, exclusion_set.begin()));