Lurker News

Comments (144) 66 threads

Earlier comments
jalonso510#
If you're translating into text that's meant to be readable, it seems like you need to add a few items to your dataset that give additional information on natural language.

For example, I added some information in the example below about which pronoun to use based on gender. Would be really neat to have this sort of information built into the tool.
Input:

    {name: "James", age:"30", hobby: "running", genderWord: "his"}

    {name: "Erin", age:"28, hobby: "cooking", genderWord: "her"}

    {name: "Owen", age:"3", hobby: "playing chase", genderWord: "his"}

    {name: "Luke", age:"1", hobby: "reading", genderWord: "his"}
Example: James is 30 years old and his favorite hobby is running

Output:

    James is 30 years old and his favorite hobby is running

    Erin is 28 years old and her favorite hobby is cooking

    Owen is 3 years old and his favorite hobby is playing chase

    Luke is 1 years old and his favorite hobby is reading
time0ut#
This works rather poorly.

  Input:
  {"message":"hello there","id":1}
  {"message":"why hello there","id":2}

  Example:
  {"id":1,"message":"hello there"}

  Output:
  {"id":1,"message":"hello there"}
  {"there":id,"message":"why hello"}
pravj2 replies#
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. :)

SilasX#
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.)
kazinator#
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
h43k3r2 replies#
One can achieve the same in sublime text using the multiple cursors and edit feature. This is great for non tech people.

For those of you who are wondering what sublime text can do, do give a visit to a sublime text video series on tutsplus, its awesome and teaches you the power of sublime text

wging#
One can also achieve it in emacs using the multiple-cursors package. https://github.com/magnars/multiple-cursors.el

But I wouldn't necessarily call emacs "great for non tech people".
(I suppose it's tiring for people to keep pointing out "yeah, emacs can do this too". Sorry.)

Load more comments