Example #1
0
int main() 
{
	vector<string,allocator>   *text_file      = retrieve_text();
        text_loc 		   *text_locations = separate_words( text_file );

        string filt_elems( "\",.;:!?)(" );
        filter_text( text_locations->first, filt_elems );
        suffix_text( text_locations->first );	
	strip_caps(  text_locations->first );

	map<string,loc*,less<string>,allocator> *text_map = build_word_map( text_locations );
        query_text( text_file, text_map );

	return 0;
}
Example #2
0
File: paper.c Project: Lundex/lima
void mangle_text()
{
    string my_text = query_text();
    int text_size = sizeof( my_text );
    int i;

    if( sizeof( my_text ) > 0 )
    {
	if( !burnt )
	{
	    burnt = 1;
	    my_text = "It's somewhat burnt, but reads as follows:\n" + my_text;
	}
	for( i = 0; i < text_size; i++ )
            if(random(max_fuel) > query_num_decays())
		if( !(my_text[i] == ' ' && random(1))) my_text[i] = '?';
	set_text( my_text );
    }
}