Hacker News new | ask | show | jobs
by pravj 4071 days ago
Nice tool and concept dude.

But it doesn't seems to look properly at the meaning of content though.

I mean, I think it just finds the first presence of what the given pattern is and generates the result.

For example, I attempted this, with input data as date/time.

input data:

  2015-09-15T09:15:17-05:00
  1998-11-05T08:15:21-05:00
  1999-01-03T04:33:30-05:00
  2000-11-05T09:16:00-05:00
pattern:

  09:15 on 09-15
result:

  09:15 on 09-15
  11:05 on 11-05
  01:03 on 01-03
  11:05 on 11-05
What I was expecting:

  09:15 on 09-15
  08:15 on 11-05
  04:33 on 01-03
  09:16 on 11-05
Although I helped it at certain level by using the same special character pattern the input data has.

And as I was afraid, it doesn't handle special characters, neither uses them in the process either, as @j2kun has mentioned in a comment.

But, it is promising at some point and have nice use cases too. :)

2 comments

With the TXR language:

  @(collect)
  @year-@month-@{day}T@hh:@mm:@ss-@tzh:@tzm
  @(end)
  @(output)
  @  (repeat)
  @hh:@mm on @month-@day
  @  (end)
  @(end)
Or:

  @(repeat)
  @year-@month-@{day}T@hh:@mm:@ss-@tzh:@tzm
  @(do
     (put-line `@hh:@mm on @month-@day`))
  @(end)
On the command line:

  $ txr -c '@(repeat)
  blah
  ...
  @(end)' - # dash for stdin or file name
From a file:

  $ txr script.txr file
I see we have a mistake in the handling of time zones; the minus sign is part of the time zone offset. Perhaps a small dash of regex, maybe:

  @year-@month-@{day}T@hh:@mm:@ss@{tzh /[+-]\d\d/}:@tzm
Shouldn't be hard to update it to allow a second example row to be given so as to disambiguate. Alternatively, just expect the user to give a more perspicuous example of what they want. (I like that word, sorry.)