Project Wonder 5.0

Package er.chronic

ERChronic is a nearly direct port to Java of the Ruby Chronic library.

See:
          Description

Class Summary
Chronic  
Options  
 

Package er.chronic Description

ERChronic is a nearly direct port to Java of the Ruby Chronic library. Currently neither Ruby Chronic nor ERChronic are internationalized, though extending the parsers to support additional languages is probably not terribly complicated (most are just a set of regular expressions, etc).

Using Chronic is very simple:

Span result = Chronic.parse("two weeks from today");

A Span object can represent either a point in time or a range of times. If a Span represents a point in time, result.isSingularity() will return true. Chronic.parse also has a variant that takes an Options object, which allows control of the parser behavior (specifying what "now" is, controlling how ERChronic handles ambiguous times, and several other settings).

Other examples of parseable strings:


Last updated: Wed, Mar 10, 2010 • 02:08 AM EST

Copyright © 2002 – 2007 Project Wonder.