Skip Menu |

This queue is for tickets about the Date-Extract CPAN distribution.

Report information
The Basics
Id: 96264
Status: resolved
Priority: 0/
Queue: Date-Extract

People
Owner: Nobody in particular
Requestors: sharyanto [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Callback interface or returning text position
This is just a note. Related to my problem in RT#95998 of replacing date strings in text, one more proper way would be for the module to provide a callback interface for each found string. Returning all found date strings works for now, but could theoretically give false positives. Imagine the future version of the module that can filter out false positive like: tweet: i performed the song "yesterday" yesterday. The module will only recognize the second "yesterday" as date, but if it returns the original string, the regex substitution that I will perform later cannot know which one is the real date. Perhaps this warrants a new module, since the interface is different and the name is no longer apt. Perhaps Date::Find or Date::Find::Callback? Another alternative, which I will attempt, is for the module to return verbatim string and position.
On Thu Jun 05 20:45:33 2014, SHARYANTO wrote: Show quoted text
> This is just a note. > > Related to my problem in RT#95998 of replacing date strings in text, > one more proper way would be for the module to provide a callback > interface for each found string. Returning all found date strings > works for now, but could theoretically give false positives. Imagine > the future version of the module that can filter out false positive > like: > > tweet: i performed the song "yesterday" yesterday. > > The module will only recognize the second "yesterday" as date, but if > it returns the original string, the regex substitution that I will > perform later cannot know which one is the real date. > > Perhaps this warrants a new module, since the interface is different > and the name is no longer apt. Perhaps Date::Find or > Date::Find::Callback? > > Another alternative, which I will attempt, is for the module to return > verbatim string and position.
Implemented 'combined' format which will return a hash of necessary information (verbatim text, position, as well as DateTime objects): https://github.com/sharyanto/operl-Date-Extract/commit/f46c085dce432d6d9925155e0acba263e3567230