This should be divided into 2 libraries:
- time parsing
npm install epic
TODO browser version.
Period objects. Periods can have start and/or end times, and/or durations. Time is fuzzy. There is also the
The api should look something like this:
var epic = ;assert;epic;epic;
Internals of the API
var epic =Period = epicPeriodInterval = epicIntervalInstant = epicInstant;// If you add this period to the 1st February (ISO) then you will get the 1st March.// If you add the same period to the 1st March you will get the 1st April.// But the duration added (in milliseconds) in these two cases is very different.var period = months: 1;var instant = Instant;instant;instant; // "Mar 1, 2012"// more complicated// this says the winter solstice is on Dec 21, 2012,// sometime between 6:00pm and 11:59pm (just made those numbers up)var winterSolstice ='Dec 21, 2012 at 6:00pm'hours: 6 // better name is "Duration";// then you could go to next years winter solstice:winterSolstice// and it should be Dec 21, 2013 from 6pm - 11:59pm
Then some BC calculations:
var originOfAgriculture = epic;// which you could manually set up like this (but would have to know the internals of how BCE is handled)var originOfAgriculture = ;originOfAgriculture;// there should be better ways to do this.http://mail-archives.apache.org/mod_mbox/xml-xalan-dev/201204.mbox/%3C4F8B913C.firstname.lastname@example.org%3E
// 1 million years agovar mya = years: -1000000;var mya = years: -1000000;// periods can have start and end dates, or they don't have to.var triassicPeriod = years: -250 * 1000000 years: -200 * 1000000;triassicPeriodstartTime;var triassicPeriod = -250 -200 'mya';var triassicPeriod = -250 'ma' 200 'ma';// maybe "unit" specifies the default operator or somethingvar triassicPeriod = -250 'mya' -200 'mya';triassicPeriodstartTimevar extinction = 65 'mya';// how many years after the triassic period?var periodBetween = triassicPeriodendTime extinction;var millionYearsAfter = periodBetween; // 200 - 65 = 135 mavar yearsAfter = periodBetween; // 200 - 65 = 135 ma
This should print the date in a standard format that can be saved to a database. Some ideas are: (TODO)
Ways of expressing time.
John left by the time he left John left by the time he ate John ate by the time he left John left by the time he ate April is usually wet. generic I was born on a Tuesday. indefinite I had swimming classes on every Tuesday in 1999. gapped interval Winter 1999 was extremely severe. vague We got married about three years ago. approximate The first three days of every month are always the busiest. set of intervals The movie is two hours long. unanchored interval She left five days after he came back. event-dependant Category Examples Adverbs simultaneously, currently, lately, today, yesterday, tomorrow Frequency Adverbs a lot, always, ever, frequently, hardly ever, never, normally, occasionally, often, frequently, rarely, sometimes, usually, hourly, daily, weekly or monthly Prepositional Phrase on Monday, at 5 o'clock, for one hour, in January, over many years, during the weekend, after the meeting, before 8pm, between 11am and 1pm, by Monday morning, since 1978, until January 2006, from 1939 to 1945, within one hour, following the meeting Postpositional Phrase five months ago, five months hence, five months on, the whole night through Other Adverbial Phrases: later than ever before, at least five years, all spring, on Tuesday at noon Adverbial Clause: when she saw the snake, as soon as I have any news Noun Phrase coming weeks, a beautiful morning, cold winters John visited his parents twice in two years. John learnt Japanese for half an hour every morning for a month. John washed cars from morning till night from June till August. John had arrived on Tuesday at noon. On Tuesday, John had arrived at noon. Last week, John had arrived 3 days ago. John had arrived at noon on Tuesday. John had arrived 3 days ago last week. Category Lexical Triggers Non-Triggers Noun minute, afternoon, midnight, day, night, weekend, month, summer, season, quarter, year, decade, cen- tury, millennium, era, semester, fu- ture, past, time, period, point instant, jiy, episode, occasion, tenure, timetable, reign, light year, megawatt hour, lifetime, history Adjective recent, former, current, future, past, daily, monthly, biannual, semian- nual, daytime, daylong, onetime, ago, preseason, short-term, long- term early, ahead, next, subsequent, fre- quent, perpetual, later, contempo- rary, simultaneous, preceding, pre- vious, existing, modern Adverb currently, lately, hourly, daily, monthly, ago (+ adverbial forms of adjective triggers) earlier, immediately, instantly, forthwith, meanwhile, heretofore, previously, next, beforehand, fol- lowing, later, soon, sooner, shortly, eventually, occasionally, once, still, again, timely, whenever Time noun/adverb now, today, yesterday, tomorrow Number 3, three, third, sixties Proper name Monday, January, New Year's Eve, Washing's Birthday, Solstice Pronouns that, then, it (only pronouns that co-refer with a markable expression) Time patterns 8:00, 12/02/2000, 1994, 1960s that cold day the next day late last night earlier that year next summer recent decades numerous Saturdays more than a month no less than 60 days just a year ago only one hour long its own future the countrys future just a year ago only one hour long five years old a few weeks later hours earlier five days after he came back three decades ago the second-best quarter ever months of renewed hostility a historic day for the European enterprise nearly four decades of experience Perhaps in the next two weeks. How 'bout the afternoon of Monday the ninth? Okay, how 'bout Tuesday March the sixteenth sometime after twelve o'clock pm? 9th Sep. 1987 an hour and 30 minutes Tuesday and Thursday Wednesday or Friday 4 o'clock next month exactly one minute ago the 2nd Sunday in May Wednesday from 3pm to 5pm in the past 3 years every 2 minutes and 30 seconds from 3pm to 5pm the rest of the year sometime between 3pm and 5pm other than Wednesday less than 1 hour and 30 minutes sometime before Sept. 9, 1987 sometime in 1987 January to March and May 2007 8am, except Mondays 9 am the following month the second Tuesday after Easter two consecutive Sundays today three Mondays all Mondays in every May all Mondays in any May any Monday in every May the courses when the student has free time We met in July last year On Monday and Tuesday three months earlier from 3pm to 6pm They are leaving on vacation two weeks from next Tuesday. A major earthquake struck Los Angeles three years ago today. This year’s summer was unusually hot. Bacon tutored an English student some Thursdays in 1998. She spent the following twelve years in various health care positions around Minnesota. Ash Wednesday Easter Sunday Christmas Day Adnan Pachachi, a onetime foreign minister who returned to Iraq on May 6 after 33 years in exile... Yeah. I'm leaving on Monday and coming back on the thirtieth, so um
- Fully specified temporal expressions, which provide all the information necessary in order to identify the point or period of time they are referring to; e.g., June 11, 1989, or the Summer of 2002.
- Underspecified temporal expressions, which require the use of some contextual infor- mation in order to interpret the point in time they are referring to; e.g., early in the morning, Monday, in recent days, few days ago, two weeks from next Tuesday, next September, the current month, last year, a decade ago.
- Durations, such as: three months and two years.
- DANTE is a rule-based system that consists of two main processing modules: a recognizer and an interpreter. The recognizer finds occurrences of temporal expressionsin documents, determines their full extents in text, and analyses their local meaning to generate their LTIMEX values. Then, for each recognized temporal expression the interpreter determines its global semantic value.
- SUTIME is a rule-based temporal tagger built on regular expression patterns. Temporal expressions are bounded in their complexity, so many of them can be captured using ﬁnite automata. As shown by systems such as FASTUS (Hobbs et al., 1997), a cascade of ﬁnite automata can be very effective at extracting information from text. With SUTIME, we follow a similar staged strategy of (i) building up patterns over individual words to ﬁnd numerical expressions; then (ii) using patterns over words and numerical expressions to ﬁnd simple temporal expressions; and ﬁnally (iii) forming composite patterns over the discovered temporal expressions.
- From Conceptual Time to Linguistic Time
- Semantics of Time-Varying Information
- Reasoning across time and the syntacticization of semantics (has example sentences)
- TIMEN: An Open Temporal Expression Normalisation Resource
- Massively Increasing TIMEX3 Resources: A Transduction Approach
- TIDES 2005 Standard for the Annotation of Temporal Expressions
- ACE Time Normalization (TERN) 2004 English Evaluation Data V1.0
- Broad-Coverage Rule-Based Processing of Temporal Expressions (PhD Thesis from 2012, SOLID)
- A Pilot Study on Annotating Temporal Relations in Text
- A Time Calculus for Natural Language (TCNL)
- The Annotation of Temporal Information in Natural Language Sentences
- A Corpus-based Study of Temporal Signals
- The Language of Time (Book)
- Developing Language Processing Components with GATE - Version 7 (and JAPE)
- JAPE: Regular Expressions over Annotations
- FASTUS: A Cascaded Finite-State Transducer for Extracting Information from Natural-Language Text
- Named Entity Extraction from Speech
- SUTIME: A Library for Recognizing and Normalizing Time Expressions
- http://timeml.org/site/timebank/timebank.html (the tempeval2 download has great docs on how to parse events)
- Currently, the standard temporal annotation scheme is TimeML which includes a speciﬁcation of the TIMEX3 standard.
- Explicit, absolute, or self-contained: These can be directly translated to a particular granularity date/time.
- Implicit, relative, or context-dependent: These need the document creation time (deictic) or a previously mentioned temporal reference/anchoring (anaphoric) to obtain a explicit date/time.
- Durative: Describing a bounded interval (or duration) that is not inherently anchored to a timeline.
- Set or frequency: Regularly recurring times, such as “every Christmas” or “each Tuesday”.
- Vague: generic mentions like “recently” or “today” in “today’s fashions”; see TIDES standard Section 4.6 (Ferro et al., 2005).
- timex / timexes
- temporal expressions
- Timex Normalisation Taxonomy
- "natural language" morphological corpus independent filetype:pdf
- DANTE (Detection and Normalisation of Temporal Expressions)