<commit_before># DateRange

__Working with date ranges made easy.__

## Usage

Create date range collection:

```
$coll = new \Danoha\DateRangeCollection([
    [ $from, $to ], // two items per range accepted
    [ 'from' => $from, 'to' => $to, ], // accepted too
    
    [ $from, NULL, ], // NULL means indefinite interval
    [ NULL, NULL, ], // and can be used on both sides
]);
```

To get your ranges back:

```
$coll->unwrap() === [
    [ 'from' => $from, 'to' => $to, ], // every range has this exact format
    [ 'from' => $from, 'to' => $to, ], // regardless of what was passed to constructor
    ...
]
```

Every method accepts collection or array of ranges:

```
$coll->intersect(
    // another collection
    new \Danoha\DateRangeCollection([ ... ])
);

$coll->intersect([
    // inlined collection (same as constructor)
    [ 'from' => $from, 'to' => $to, ]
]);
```

Note: definite intervals are handled as inclusive on both sides.

## Available methods

Note: all methods returning collection return new instance.
That means calling `$coll->add($range)` twice on the same
collection will create two instances on neither of them will
contain both added ranges.

- unwrap - get underlying date ranges in common format,
- add - add given ranges to collection,
- includes - tests if collection includes given date,
- join - joins ranges in current collection if possible,
- intersect - calculates all intersections with given ranges.<commit_msg>Fix readme typo<commit_after># DateRange

__Working with date ranges made easy.__

## Usage

Create date range collection:

```
$coll = new \Danoha\DateRangeCollection([
    [ $from, $to ], // two items per range accepted
    [ 'from' => $from, 'to' => $to, ], // accepted too
    
    [ $from, NULL, ], // NULL means indefinite interval
    [ NULL, NULL, ], // and can be used on both sides
]);
```

To get your ranges back:

```
$coll->unwrap() === [
    [ 'from' => $from, 'to' => $to, ], // every range has this exact format
    [ 'from' => $from, 'to' => $to, ], // regardless of what was passed to constructor
    ...
]
```

Every method accepts collection or array of ranges:

```
$coll->intersect(
    // another collection
    new \Danoha\DateRangeCollection([ ... ])
);

$coll->intersect([
    // inlined collection (same as constructor)
    [ 'from' => $from, 'to' => $to, ]
]);
```

Note: definite intervals are handled as inclusive on both sides.

## Available methods

Note: all methods returning collection return new instance.
That means calling `$coll->add($range)` twice on the same
collection will create two instances and neither of them will
contain both added ranges.

- unwrap - get underlying date ranges in common format,
- add - add given ranges to collection,
- includes - tests if collection includes given date,
- join - joins ranges in current collection if possible,
- intersect - calculates all intersections with given ranges.
{'fraction_non_alphanumeric': 0.1351629502572899, 'fraction_numerical': 0.0, 'mean_word_length': 3.32, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '3558656', 'n_tokens_mistral': 848, 'n_tokens_neox': 813, 'n_words': 345}