<commit_before><?php

/**
 * @file
 * Class EventItemizer
 */

namespace Roomify\Bat\Event;

use Roomify\Bat\Event\EventInterface;
use Roomify\Bat\Unit\Unit;

/**
 * The EventItemizer class does the hard work of splitting an event into discrete time
 * units in the following structure
 * [BAT_DAY][year][month][day][value]
 * [BAT_HOUR][year][month][day][hour][value]
 * [BAT_MINUTE][year][month][hour][minute][value]
 *
 * This data structure allows to quickly retrieve the state of a unit for a provided time
 * period. The value is either the default value of the unit or the value that the event
 * introduced. If the value in either BAT_DAY or BAT_HOUR is -1 it means that that specific
 * day or that specific hour are non-determinant. This means that in order to determine the
 * value of the event for that point in time we need to look at a lower level of granularity.
 *
 * Example - consider breaking up the following event
 *
 * start-date: 2016-01-01 1210
 * end-date: 2016-01-03 1210
 * value: 10
 *
 * [BAT_DAY][2016][01][d1][-1] - The first day starts at 1210 so the DAY array is not enough
 * [BAT_DAY][2016][01][d2][10] - The second day is a full day at the same value of 10
 * [BAT_DAY][2016][01][d3][-1] - The last day is no a full day so the day array in non-determinant

 * [BAT_HOUR][2016][01][d1][h12][-1] - The first hour of the event starts at 10 minutes so the hour is non-determinant
 * [BAT_HOUR][2016][01][d1][h13][10]
 * [BAT_HOUR][2016][01][d1][h14][10]
 * [BAT_HOUR][2016][01][d1][h15][10]
 * [BAT_HOUR][2016][01][d1][h16][10]
 * [BAT_HOUR][2016][01][d1][h17][10]
 * [BAT_HOUR][2016][01][d1][h18][10]
 * [BAT_HOUR][2016][01][d1][h19][10]
 * [BAT_HOUR][2016][01][d1][h20][10]
 * [BAT_HOUR][2016][01][d1][h21][10]
 * [BAT_HOUR][2016][01][d1][h22][10]
 * [BAT_HOUR][2016][01][d1][h23][10]
 *                                    - we don't need to state anything about hours on the 2nd of Jan since the day array is determinant
 * [BAT_HOUR][2016][01][d3][h01][10]
 * [BAT_HOUR][2016][01][d3][h02][10]
 * [BAT_HOUR][2016][01][d3][h03][10]
 * [BAT_HOUR][2016][01][d3][h04][10]<commit_msg>Remove empty line<commit_after><?php

/**
 * @file
 * Class EventItemizer
 */

namespace Roomify\Bat\Event;

use Roomify\Bat\Event\EventInterface;
use Roomify\Bat\Unit\Unit;

/**
 * The EventItemizer class does the hard work of splitting an event into discrete time
 * units in the following structure
 * [BAT_DAY][year][month][day][value]
 * [BAT_HOUR][year][month][day][hour][value]
 * [BAT_MINUTE][year][month][hour][minute][value]
 *
 * This data structure allows to quickly retrieve the state of a unit for a provided time
 * period. The value is either the default value of the unit or the value that the event
 * introduced. If the value in either BAT_DAY or BAT_HOUR is -1 it means that that specific
 * day or that specific hour are non-determinant. This means that in order to determine the
 * value of the event for that point in time we need to look at a lower level of granularity.
 *
 * Example - consider breaking up the following event
 *
 * start-date: 2016-01-01 1210
 * end-date: 2016-01-03 1210
 * value: 10
 *
 * [BAT_DAY][2016][01][d1][-1] - The first day starts at 1210 so the DAY array is not enough
 * [BAT_DAY][2016][01][d2][10] - The second day is a full day at the same value of 10
 * [BAT_DAY][2016][01][d3][-1] - The last day is no a full day so the day array in non-determinant
 * [BAT_HOUR][2016][01][d1][h12][-1] - The first hour of the event starts at 10 minutes so the hour is non-determinant
 * [BAT_HOUR][2016][01][d1][h13][10]
 * [BAT_HOUR][2016][01][d1][h14][10]
 * [BAT_HOUR][2016][01][d1][h15][10]
 * [BAT_HOUR][2016][01][d1][h16][10]
 * [BAT_HOUR][2016][01][d1][h17][10]
 * [BAT_HOUR][2016][01][d1][h18][10]
 * [BAT_HOUR][2016][01][d1][h19][10]
 * [BAT_HOUR][2016][01][d1][h20][10]
 * [BAT_HOUR][2016][01][d1][h21][10]
 * [BAT_HOUR][2016][01][d1][h22][10]
 * [BAT_HOUR][2016][01][d1][h23][10]
 *                                    - we don't need to state anything about hours on the 2nd of Jan since the day array is determinant
 * [BAT_HOUR][2016][01][d3][h01][10]
 * [BAT_HOUR][2016][01][d3][h02][10]
 * [BAT_HOUR][2016][01][d3][h03][10]
 * [BAT_HOUR][2016][01][d3][h04][10]
{'fraction_non_alphanumeric': 0.164344746162928, 'fraction_numerical': 0.1114521841794569, 'mean_word_length': 4.4728682170542635, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4710407', 'n_tokens_mistral': 1863, 'n_tokens_neox': 1565, 'n_words': 447}