++




- 6


continue;

}

loc *ploc = (*word_map) [ query_text ];

set<short,less<short>,allocator> occurrence_1i nes;

loc::iterator liter = ploc->begin(),

liter_end = ploc->end();

while ( liter != liter_end ) {

occurrence_lines.1nsert(

occurrence_lines.end(), (*liter).first);

++liter;

}

register int size = occurrence_lines.size();

cout << "\n" << query_text

<< " occurs " << size

<< (size == 1 ? " time:" : " times:")

<< "\n\n";

set<short,less<short>,allocator>::iterator

it=occurrence_lines.begin();

for ( ; it != occurrence_"lines.end(); ++it ) {

int line = *it;

cout << "\t( line "

// 1,

//

<< line + 1 << " ) "

<< (*lines_of_text)[line] << endl;

}

cout << endl;

}

while ( ! query_text.empty() );

cout << "Ok, bye!\n";

}

void

TextQuery::

display_map_text()

{

typedef map<string,loc*, less<string>, allocator> map_text;

map_text::iterator iter = word_map->begin(),

iter_end = word_map->end();

while ( iter != iter_end ) {

cout << "word: " << (*iter).first << " (";

int loc_cnt = 0;

loc *text_locs = (*iter).second;

loc::iterator liter = text_locs->begin(),

liter_end = text_locs->end();

while ( liter != liter_end )

{