Skip to content

Commit

Permalink
update README.md and description, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-r-warren committed May 18, 2019
1 parent abf00e7 commit 593a872
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.0

- Add date parsing

## 0.2.8

- Make the deployment script executable
Expand Down
42 changes: 39 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ Features handling of a wide range of formats: beyond just "\<first> \<last>" and
```dart
import 'package:best_effort_parser/name.dart';
void main(List<String> arguments) {
print(NameParser.basic().parse(arguments.join(' ')).diagnosticString());
}
void main(List<String> arguments) =>
print(NameParser.basic().parse(arguments.join(' ')).diagnosticString());
```

Demo:
Expand All @@ -46,6 +45,43 @@ Demo:

Customization of both parsing and output type is available.

## Date Parsing
#### `best_effort_parser/date.dart`

Provides parsing of dates by collecting years, months, and days and assembling those parts into a list. Each entry in that output list represents a singular date, so a string containing multiple dates or a range will have multiple entries in its output.

### Example:
#### `date_example.dart`

```dart
import 'package:best_effort_parser/date.dart';
void main(List<String> arguments) =>
DateParser.basic().parse(arguments.join(' ')).forEach(print);
```

Demo:
```text
λ dart .\date_example.dart 'January 1st, 2019'
[Day]: 1 [Month]: 1 [Year]: 2019
λ dart .\date_example.dart '1/2/3'
[Day]: 2 [Month]: 1 [Year]: 2003
λ dart .\date_example.dart '10/10/90 - 3/13/18'
[Day]: 10 [Month]: 10 [Year]: 1990
[Day]: 13 [Month]: 3 [Year]: 2018
λ dart .\date_example.dart 'Spring-Summer 2010'
[Month]: 3 [Year]: 2010
[Month]: 6 [Year]: 2010
λ dart .\date_example.dart '1999-15-6'
[Day]: 6 [Month]: 3 [Year]: 1999
```

Customization of both parsing and output type is available.

## Feature requests and bugs

Please file feature requests and bugs at the [issue tracker][tracker].
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: best_effort_parser
description: Best-effort parsing for names with unknown formats (like unstructured user input)
version: 0.2.8
description: Best-effort parsing for names and dates with unknown formats (like unstructured user input)
version: 0.3.0
homepage: https://github.com/jack-r-warren/best_effort_parser
author: Jack Warren <jack@jackwarren.info>

Expand Down

0 comments on commit 593a872

Please sign in to comment.