<commit_before>#include "dictionary.h"

#include <cassert>

void Dictionary::addWord(const char* word) {
    if (addedWords.find(word) != addedWords.end()) {
        fprintf(stderr, "Redefining word '%s' is not allowed\n", word);
        exit(1);
    }
    addedWords.insert(word);

    auto missingIt = missingWords.find(word);
    if (missingIt != missingWords.end()) {
        missingWords.erase(missingIt);
    }
}

void Dictionary::markAsUsed(const char* word) {
    missingWords.insert(word);
}<commit_msg>bugfix dictionary<commit_after>#include "dictionary.h"

#include <cassert>

void Dictionary::addWord(const char* word) {
    if (addedWords.find(word) != addedWords.end()) {
        fprintf(stderr, "Redefining word '%s' is not allowed\n", word);
        exit(1);
    }
    addedWords.insert(word);

    auto missingIt = missingWords.find(word);
    if (missingIt != missingWords.end()) {
        missingWords.erase(missingIt);
    }
}

void Dictionary::markAsUsed(const char* word) {
    if (addedWords.find(word) == addedWords.end()) {
        missingWords.insert(word);
    }
}
{'fraction_non_alphanumeric': 0.15032080659945005, 'fraction_numerical': 0.0018331805682859762, 'mean_word_length': 3.588235294117647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1592134', 'n_tokens_mistral': 368, 'n_tokens_neox': 350, 'n_words': 70}