<commit_before>describe("readerTools-libSynphony tests", function() {

    it("addWordsFromFile", function() {

        var model = new ReaderToolsModel();
        var fileContents = 'The cat sat on the mat. The rat sat on the cat.';

        model.addWordsFromFile(fileContents);
        expect(model.allWords).toEqual({the: 4, cat: 2, sat: 2, on: 2, mat: 1, rat: 1});
    });

    it("addWordsToSynphony", function() {

        lang_data = null;
        var model = new ReaderToolsModel();

        var settings = new Object();
        settings.letters = 'a b c d e f g h i j k l m n o p q r s t u v w x y z';
        settings.letterCombinations = 'ai oo sh ng th ing';
        settings.moreWords = 'one two three';
        settings.stages = [];

        settings.stages.push({"letters":"a c m r t","sightWords":"canine feline"});
        settings.stages.push({"letters":"d g o e s","sightWords":"carnivore omnivore"});
        settings.stages.push({"letters":"i l n th","sightWords":"rodent"});

        var sampleFileContents = 'The cat sat on the mat. The rat sat on the cat.';

        var synphony = model.getSynphony();
        synphony.loadSettings(JSON.stringify(settings));

        model.addWordsFromFile(sampleFileContents);
        model.addWordsToSynphony();
        model.updateWordList();

        expect(synphony.stages.length).toBe(3);
        expect(_.pluck(model.getStageWords(1), 'Name')).toEqual(['cat', 'mat', 'rat']);
        expect(_.pluck(model.getStageWords(2), 'Name')).toEqual(['cat', 'sat', 'mat', 'rat']);
        expect(_.pluck(model.getStageWords(3), 'Name')).toEqual(['cat', 'sat', 'mat', 'rat', 'one', 'on', 'the']);

        expect(synphony.stages[0].sightWords).toEqual('canine feline');<commit_msg>Fix unit test<commit_after>describe("readerTools-libSynphony tests", function() {

    it("addWordsFromFile", function() {

        var model = new ReaderToolsModel();
        var fileContents = 'The cat sat on the mat. The rat sat on the cat.';

        model.addWordsFromFile(fileContents);
        expect(model.allWords).toEqual({the: 4, cat: 2, sat: 2, on: 2, mat: 1, rat: 1});
    });

    it("addWordsToSynphony", function() {

        lang_data = null;
        var model = new ReaderToolsModel();

        var settings = new Object();
        settings.letters = 'a b c d e f g h i j k l m n o p q r s t u v w x y z';
        settings.letterCombinations = 'ai oo sh ng th ing';
        settings.moreWords = 'one two three';
        settings.stages = [];

        settings.stages.push({"letters":"a c m r t","sightWords":"canine feline"});
        settings.stages.push({"letters":"d g o e s","sightWords":"carnivore omnivore"});
        settings.stages.push({"letters":"i l n th","sightWords":"rodent"});

        var sampleFileContents = 'The cat sat on the mat. The rat sat on the cat.';

        var synphony = model.getSynphony();
        synphony.loadSettings(JSON.stringify(settings));

        model.addWordsFromFile(sampleFileContents);
        model.addWordsToSynphony();
        model.updateWordList();

        expect(synphony.stages.length).toBe(3);
        expect(_.pluck(model.getStageWords(1), 'Name')).toEqual(['cat', 'mat', 'rat']);
        expect(_.pluck(model.getStageWords(2), 'Name')).toEqual(['cat', 'sat', 'mat', 'rat']);
        expect(_.pluck(model.getStageWords(3), 'Name')).toEqual(['cat', 'sat', 'mat', 'rat', 'three', 'one', 'on', 'the']);

        expect(synphony.stages[0].sightWords).toEqual('canine feline');
{'fraction_non_alphanumeric': 0.1650875681883434, 'fraction_numerical': 0.006316393913293138, 'mean_word_length': 3.108490566037736, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6125485', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1069, 'n_words': 290}