<commit_before>/*
 * Copyright 2014 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jonnyware.timetracker.cli;

import com.jonnyware.timetracker.*;
import org.joda.time.Interval;
import org.joda.time.Period;

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Map;

public class PrintCommand {
    public void run(Map<String, Object> parsed, TimeEntryParser parser) {
        Integer year = parser.getYear();
        System.out.printf("Year: %d%n", year);
        System.out.println("+------+---------+-----------+");
        System.out.println("| Week |  Total  |    Diff   |");
        System.out.println("+------+---------+-----------+");

        Collection<NormalDay> entries = parser.listTimeEntries();
        Collection<SpecialDay> vacations = new LinkedList<SpecialDay>();
        vacations.addAll(parser.listVacations());
        vacations.addAll(parser.neutralDays());
        DateGroupByWeek vacationByWeek = new DateGroupByWeek(vacations);

        IntervalGroupBy groupBy = new IntervalGroupBy(entries);
        Map<Integer, Collection<NormalDay>> weeks = groupBy.weekOfYear();

        DefaultWeekdayDurationParser defaultDurationParser = new DefaultWeekdayDurationParser(parsed);
        Map<Integer, Period> hoursPerWeekday = defaultDurationParser.getSpecifiedMergedWithDefault();

        IgnoredDays ignoredDays = new IgnoredDays(parser.listVacations(), parser.neutralDays());
        DiffCalculator calculator = new DiffCalculator(hoursPerWeekday, ignoredDays.union());
        ExtraInformation extraInformation = new ExtraInformation(year);
<commit_msg>Include the total number of neutral days and vacations.<commit_after>/*
 * Copyright 2014 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jonnyware.timetracker.cli;

import com.jonnyware.timetracker.*;
import org.joda.time.Interval;
import org.joda.time.Period;

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Map;

public class PrintCommand {
    public void run(Map<String, Object> parsed, TimeEntryParser parser) {
        Integer year = parser.getYear();
        Collection<Vacation> vacations = parser.listVacations();
        Collection<NeutralDay> neutralDays = parser.neutralDays();

        System.out.printf("Year:          %d%n", year);
        System.out.printf("Vacation days: %d%n", vacations.size());
        System.out.printf("Neutral days:  %d%n", neutralDays.size());
        System.out.println("+------+---------+-----------+");
        System.out.println("| Week |  Total  |    Diff   |");
        System.out.println("+------+---------+-----------+");

        Collection<NormalDay> entries = parser.listTimeEntries();
        Collection<SpecialDay> specialDays = new LinkedList<SpecialDay>();
        specialDays.addAll(vacations);
        specialDays.addAll(neutralDays);
        DateGroupByWeek vacationByWeek = new DateGroupByWeek(specialDays);

        IntervalGroupBy groupBy = new IntervalGroupBy(entries);
        Map<Integer, Collection<NormalDay>> weeks = groupBy.weekOfYear();

        DefaultWeekdayDurationParser defaultDurationParser = new DefaultWeekdayDurationParser(parsed);
        Map<Integer, Period> hoursPerWeekday = defaultDurationParser.getSpecifiedMergedWithDefault();

        IgnoredDays ignoredDays = new IgnoredDays(vacations, neutralDays);
        DiffCalculator calculator = new DiffCalculator(hoursPerWeekday, ignoredDays.union());
        ExtraInformation extraInformation = new ExtraInformation(year);

{'fraction_non_alphanumeric': 0.12223187147199305, 'fraction_numerical': 0.0034737299174989146, 'mean_word_length': 3.5568743818001978, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6613187', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1196, 'n_words': 348}