<commit_before># Timelord
[![Code Climate](https://codeclimate.com/github/halogenandtoast/timelord.png)](https://codeclimate.com/github/halogenandtoast/timelord)
[![Build Status](https://travis-ci.org/halogenandtoast/timelord.svg?branch=mm-matchers)](https://travis-ci.org/halogenandtoast/timelord)

Timelord parses dates out of strings. The string itself can contain non-date text - for instance: "Call Matt on Tuesday"
will return a date object for the upcoming Tuesday.

## Usage

```ruby
require 'timelord'
Timelord.parse("Tuesday").to_s # "2011-01-04"
Timelord.parse("On Tuesday go for a walk").to_s # "2011-01-04"
```


For more examples, check out the [spec](https://github.com/halogenandtoast/timelord/blob/master/spec/timelord_spec.rb)

## Date format

The default date format is the international format. 11/01 is January 11th.

To use the american date format pass in :american as the second parameter

```ruby
Timelord.parse("11/01").to_s # "2011-01-11"
Timelord.parse("11/01", :american) # "2011-11-01"
```
<commit_msg>Fix README to mention format correctly<commit_after># Timelord
[![Code Climate](https://codeclimate.com/github/halogenandtoast/timelord.png)](https://codeclimate.com/github/halogenandtoast/timelord)
[![Build Status](https://travis-ci.org/halogenandtoast/timelord.svg?branch=mm-matchers)](https://travis-ci.org/halogenandtoast/timelord)

Timelord parses dates out of strings. The string itself can contain non-date text - for instance: "Call Matt on Tuesday"
will return a date object for the upcoming Tuesday.

## Usage

```ruby
require 'timelord'
Timelord.parse("Tuesday").to_s # "2011-01-04"
Timelord.parse("On Tuesday go for a walk").to_s # "2011-01-04"
```


For more examples, check out the [spec](https://github.com/halogenandtoast/timelord/blob/master/spec/timelord_spec.rb)

## Date format

The default date format is the international format. 11/01 is January 11th.

To use the american date format pass in :american as the second parameter

```ruby
Timelord.parse("11/01").to_s # "2011-01-11"
Timelord.parse("11/01", format: :american) # "2011-11-01"
```

{'fraction_non_alphanumeric': 0.14067715784453982, 'fraction_numerical': 0.043872198378636144, 'mean_word_length': 5.188790560471976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, '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': '4342548', 'n_tokens_mistral': 791, 'n_tokens_neox': 718, 'n_words': 180}