create_lists.cpp
void remove_triple_letters() {
    word_occ ptr;

    // catalogue starting data for analysis purposes
    std::cout << "Removing triple letter occurences." << '\n';
    std::cout << "Starting list size is: " << words_vector.size() << '\n';
    int start = words_vector.size();

    // go through each word in the vector
    for (std::vector<word_occ>::iterator it = words_vector.begin(); it != words_vector.end(); ++it) {
        ptr = *it;

        // convert strings into c-strings to check individual characters within them
        const char* wordc = ptr.word.c_str();

        // create trackers for consecutive letters. One to keep track of the last letter, and a count of the current streak of consecutive letters
        int consecutive_letters = 1;
        char check_letter;
        for (int i = 0; i < strlen(wordc); i++) {
            // if the current letter matches the previous one, increase the count
            if (wordc[i] == check_letter) {
                consecutive_letters++;
                // if that count exceeds three, remove the word and break from the loop
                if (consecutive_letters >= 3) {
                    words_vector.erase(it);
                    break;
                }
            } else { // if the current letter does not match the last one, reset the count
                consecutive_letters = 1;
            }
            // update the previous letter
            check_letter = wordc[i];
        }
    }

    // output how many words remain and the amount of words removed for analysis purposes
    std::cout << "Size after removing words with 3 or more consecutive letters is: " << words_vector.size() << '\n';
    int diff = start - words_vector.size();
    std::cout << "---Removed " << diff << " entries" << '\n' << "==========================================================" << '\n' << '\n';
}
/*
very few, if not zero words in the english language contain instances of the same letter 3 times in a row.
despite that, the dataset contains many instances of just that. Be it in the form of jibberish words like 'aaaaah' or in roman numerals like 'xxxiii',
these words must be removed.
*/
very few, if not zero words in the english language contain instances of the same letter 3 times in a row.
despite that, the dataset contains many instances of just that. Be it in the form of jibberish words like 'aaaaah' or in roman numerals like 'xxxiii',
these words must be removed.
very few if not zero words in the english language contain instances of the same letter 3 times in a row . despite that the dataset contains many instances of just that . Be it in the form of jibberish words like ' aaaaah ' or in roman numerals like ' xxxiii ' these words must be removed .
void remove_triple_letters() {
    word_occ ptr;
    std::cout << "Removing triple letter occurences." << '\n';
    std::cout << "Starting list size is: " << words_vector.size() << '\n';
    int start = words_vector.size();
    for (std::vector<word_occ>::iterator it = words_vector.begin(); it != words_vector.end(); ++it) {
        ptr = *it;
        const char* wordc = ptr.word.c_str();
        int consecutive_letters = 1;
        char check_letter;
        for (int i = 0; i < strlen(wordc); i++) {
            if (wordc[i] == check_letter) {
                consecutive_letters++;
                if (consecutive_letters >= 3) {
                    words_vector.erase(it);
                    break;
                }
            } else { 
                consecutive_letters = 1;
            }
            check_letter = wordc[i];
        }
    }
    std::cout << "Size after removing words with 3 or more consecutive letters is: " << words_vector.size() << '\n';
    int diff = start - words_vector.size();
    std::cout << "---Removed " << diff << " entries" << '\n' << "==========================================================" << '\n' << '\n';
}
void remove_triple_letters ( ) { word_occ ptr ; std :: cout << " " << ' \n ' ; std :: cout << " " << words_vector . size ( ) << ' \n ' ; int start = words_vector . size ( ) ; for ( std :: vector < word_occ > :: iterator it = words_vector . begin ( ) ; it != words_vector . end ( ) ; ++ it ) { ptr = * it ; const char * wordc = ptr . word . c_str ( ) ; int consecutive_letters = 1 ; char check_letter ; for ( int i = 0 ; i < strlen ( wordc ) ; i ++ ) { if ( wordc [ i ] == check_letter ) { consecutive_letters ++ ; if ( consecutive_letters >= 3 ) { words_vector . erase ( it ) ; break ; } } else { consecutive_letters = 1 ; } check_letter = wordc [ i ] ; } } std :: cout << " " << words_vector . size ( ) << ' \n ' ; int diff = start - words_vector . size ( ) ; std :: cout << " " << diff << " " << ' \n ' << " " << ' \n ' << ' \n ' ; }
very few, if not zero words in the english language contain instances of the same letter 3 times in a row.
very few if not zero words in the english language contain instances of the same letter 3 times in a row .
// catalogue starting data for analysis purposes
 // go through each word in the vector
 // convert strings into c-strings to check individual characters within them
 // create trackers for consecutive letters. One to keep track of the last letter, and a count of the current streak of consecutive letters
 // if the current letter matches the previous one, increase the count
 // if that count exceeds three, remove the word and break from the loop
 // if the current letter does not match the last one, reset the count
 // update the previous letter
 // output how many words remain and the amount of words removed for analysis purposes
