{"action":"created","issue":{"url":"https://api.github.com/repos/bear/parsedatetime/issues/92","labels_url":"https://api.github.com/repos/bear/parsedatetime/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/bear/parsedatetime/issues/92/comments","events_url":"https://api.github.com/repos/bear/parsedatetime/issues/92/events","html_url":"https://github.com/bear/parsedatetime/pull/92","id":79860662,"number":92,"title":"Avoid parsing numbers within larger strings as if they were times","user":{"login":"idpaterson","id":507058,"avatar_url":"https://avatars.githubusercontent.com/u/507058?v=3","gravatar_id":"","url":"https://api.github.com/users/idpaterson","html_url":"https://github.com/idpaterson","followers_url":"https://api.github.com/users/idpaterson/followers","following_url":"https://api.github.com/users/idpaterson/following{/other_user}","gists_url":"https://api.github.com/users/idpaterson/gists{/gist_id}","starred_url":"https://api.github.com/users/idpaterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idpaterson/subscriptions","organizations_url":"https://api.github.com/users/idpaterson/orgs","repos_url":"https://api.github.com/users/idpaterson/repos","events_url":"https://api.github.com/users/idpaterson/events{/privacy}","received_events_url":"https://api.github.com/users/idpaterson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-23T14:23:42Z","updated_at":"2015-05-26T15:40:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bear/parsedatetime/pulls/92","html_url":"https://github.com/bear/parsedatetime/pull/92","diff_url":"https://github.com/bear/parsedatetime/pull/92.diff","patch_url":"https://github.com/bear/parsedatetime/pull/92.patch"},"body":"For example, neither \"$300\" nor \"300ml\" are intended to be \"3:00\" but \"300\" and \"300am\" are fine. The time must be preceded by a space or hyphen (the hyphen is to allow *300-400* style ranges) or appear at the beginning of the string. The time (or time + meridian for AM/PM locales) must be followed by a word boundary.\r\n\r\nI opted for `(\\s|-|^)` here since, especially considering currencies, many different symbols can precede a number and most will be treated as a word boundary. `\\b` would not have fixed the *$300* case. \r\n\r\nThis is another one where I'm not sure if all cases are covered but the tests pass and it seems in general to be an improvement. \r\n\r\nI did not make any changes to `evalRanges` via `RE_RTIMEHMS` and `RE_RTIMEHMS2` which look like they may still have word boundary issues. Both `(\\s?|^)` (which due to the `?` can match anything) and the lack of `\\b` are a bit concerning. For completion since this version is somewhat focused on word boundary fixes we should probably fix those as well.\r\n\r\nOtherwise, I think this wraps up my work for this version. Will post a few ideas for the future but I'm not quite ready to get into some of the other parsedatetime-related issues that have come up in my project."},"comment":{"url":"https://api.github.com/repos/bear/parsedatetime/issues/comments/105571105","html_url":"https://github.com/bear/parsedatetime/pull/92#issuecomment-105571105","issue_url":"https://api.github.com/repos/bear/parsedatetime/issues/92","id":105571105,"user":{"login":"philiptzou","id":809865,"avatar_url":"https://avatars.githubusercontent.com/u/809865?v=3","gravatar_id":"","url":"https://api.github.com/users/philiptzou","html_url":"https://github.com/philiptzou","followers_url":"https://api.github.com/users/philiptzou/followers","following_url":"https://api.github.com/users/philiptzou/following{/other_user}","gists_url":"https://api.github.com/users/philiptzou/gists{/gist_id}","starred_url":"https://api.github.com/users/philiptzou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philiptzou/subscriptions","organizations_url":"https://api.github.com/users/philiptzou/orgs","repos_url":"https://api.github.com/users/philiptzou/repos","events_url":"https://api.github.com/users/philiptzou/events{/privacy}","received_events_url":"https://api.github.com/users/philiptzou/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T15:40:23Z","updated_at":"2015-05-26T15:40:23Z","body":"@idpaterson \r\n\r\nSure I have some:\r\n\r\n```python\r\n        self.assertEqual(\r\n            text_normalize('2pmd.t.'),\r\n            '2pm d.t.')\r\n        self.assertEqual(\r\n            text_normalize('9.15 pmest'),\r\n            '9:15pm est')\r\n        self.assertEqual(\r\n            text_normalize('on feb 14th, at 330 pm'),\r\n            'on february 14th, at 3:30pm')\r\n        self.assertEqual(\r\n            text_normalize('on feb 14th, at 0330 pm'),\r\n            'on february 14th, at 03:30pm')\r\n        self.assertEqual(\r\n            text_normalize('tue 10:00 am?'),\r\n            'tuesday 10:00am?')\r\n        self.assertEqual(\r\n            text_normalize('tuesday 10:00 am?'),\r\n            'tuesday 10:00am?')\r\n        month = datetime.now().strftime('%B').lower()\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 1pm on the 25th\"),\r\n            \"let's do 1pm on {0} 25th\".format(month))\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 1pm on 25th\"),\r\n            \"let's do 1pm on {0} 25th\".format(month))\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 1pm on may 25th\"),\r\n            \"let's do 1pm on may 25th\")\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 19th at 12:00\"),\r\n            \"let's do may 19th at 12:00\")\r\n        self.assertEqual(\r\n            text_normalize(\"1.06 in 2013?\"),\r\n            \"1.06.2013?\")\r\n        self.assertEqual(\r\n            text_normalize(\"1.06 on 2013?\"),\r\n            \"1.06 on 2013?\")\r\n        self.assertEqual(\r\n            text_normalize(\"tomorrow at 5.30pm?\"),\r\n            \"tomorrow at 5:30pm?\")\r\n        self.assertEqual(\r\n            text_normalize(\"tomorrow 5/30?\"),\r\n            \"tomorrow 5:30?\")\r\n        self.assertEqual(\r\n            text_normalize(\"tomorrow 2.15?\"),\r\n            \"tomorrow 2:15?\")\r\n        self.assertEqual(\r\n            text_normalize(\"at 8.30 or 9?\"),\r\n            \"at 8:30 or 9:00?\")\r\n        self.assertEqual(\r\n            text_normalize(\"at 8.30 or 9.30?\"),\r\n            \"at 8:30 or 9:30?\")\r\n        self.assertEqual(\r\n            text_normalize(\"tomorrow 2 or 3?\"),\r\n            \"tomorrow 2:00 or 3:00?\")\r\n        self.assertEqual(\r\n            text_normalize(\"how's mon 2/24 a\"),\r\n            \"how is monday 2:24am\")\r\n        self.assertEqual(\r\n            text_normalize(\"5.30 on sunday?\"),\r\n            \"5:30 on sunday?\")\r\n        self.assertEqual(\r\n            text_normalize(\"5.30 on the sunday?\"),\r\n            \"5:30 on the sunday?\")\r\n        self.assertEqual(\r\n            text_normalize(\"how about 8 on monday?\"),\r\n            \"how about 8:00 on monday?\")\r\n        # do not convert, perhaps date\r\n        self.assertEqual(\r\n            text_normalize(\"5.30 sunday?\"),\r\n            \"5.30 sunday?\")\r\n        self.assertEqual(\r\n            text_normalize(\"let's try 9.15 pst on friday?\"),\r\n            \"let's try 9:15 pst on friday?\")\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 2/24 at 11:00\"),\r\n            \"let's do 2/24 at 11:00\")\r\n        self.assertEqual(\r\n            text_normalize('6.32?'), '6:32?')\r\n        self.assertEqual(\r\n            text_normalize('6.32 tomorrow?'), '6:32 tomorrow?')\r\n        self.assertEqual(\r\n            text_normalize('6:32 tomorrow?'), '6:32 tomorrow?')\r\n        self.assertEqual(\r\n            text_normalize('around 630/7?'), 'around 6:30 / 7:00?')\r\n        self.assertEqual(\r\n            text_normalize('our 1st #myTalkManuary win'),\r\n            'our 1st #mytalkmanuary win')\r\n        self.assertEqual(\r\n            text_normalize(\"How's Fri afternoon 1-2:30p?\"),\r\n            \"how is friday afternoon 1:00 - 2:30pm?\")\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 11 on tuesday\"),\r\n            \"let's do 11:00 on tuesday\")\r\n        self.assertEqual(\r\n            text_normalize(\"let's do 11:00 on tuesday\"),\r\n            \"let's do 11:00 on tuesday\")\r\n        self.assertEqual(\r\n            text_normalize(\"11:00 on tuesday\"),\r\n            \"11:00 on tuesday\")\r\n        self.assertEqual(\r\n            text_normalize(\"may 11\"),\r\n            \"may 11\")\r\n        self.assertEqual(\r\n            text_normalize(\"11 may\"),\r\n            \"11 may\")\r\n        self.assertEqual(\r\n            text_normalize(\"before 9\"),\r\n            \"before 9:00\")\r\n        self.assertEqual(\r\n            text_normalize('tomorrow 2-4?'),\r\n            'tomorrow 2:00 - 4:00?')\r\n        self.assertEqual(\r\n            text_normalize('tomorrow 2-435?'),\r\n            'tomorrow 2:00 - 4:35?')\r\n        self.assertEqual(\r\n            text_normalize('tomorrow 235-4?'),\r\n            'tomorrow 2:35 - 4:00?')\r\n        self.assertEqual(\r\n            text_normalize('tomorrow 230-430?'),\r\n            'tomorrow 2:30 - 4:30?')\r\n        self.assertEqual(\r\n            text_normalize('tomorrow 23-43?'),\r\n            'tomorrow 23:43?')\r\n        self.assertEqual(\r\n            text_normalize('tomorrow 83-93?'),\r\n            'tomorrow 83-93?')\r\n        self.assertEqual(\r\n            text_normalize('august 2-4?'),\r\n            'august 2-4?')\r\n        self.assertEqual(\r\n            text_normalize('how about 2-4 october?'),\r\n            'how about 2-4 october?')\r\n        self.assertEqual(\r\n            text_normalize('6?'), '6:00?')\r\n        self.assertEqual(\r\n            text_normalize('6 tomorrow?'), '6:00 tomorrow?')\r\n        self.assertEqual(\r\n            text_normalize('On Tuesday - 2pdt?'), 'on tuesday - 2:00 pdt?')\r\n        self.assertEqual(\r\n            text_normalize('On Tuesday - 2:12pdt?'), 'on tuesday - 2:12 pdt?')\r\n```"}}