Hacker News new | ask | show | jobs
Show HN: Strans – Sed alternative that automatically learns from examples (github.com)
158 points by inventitech 2658 days ago
5 comments

So you are describing the end effect and the program figures out what you want? Wow. This post has inspired me. I want to add a comment here that:

1. makes you laugh

2. blows your mind with its insight

3. is considered deeply relevant

I can't actually come up with it, but now that I have given you the description, please simulate the comment in your mind and give me credit for it.

This is a good article to come up in Maruary or Apruary.
Does that refers for the months of March and April???
Jan -> January, Feb -> February; Mar -> ... Frequently used parts of language are often irregular. Fortunately, I don't think plaintext you'd use sed against is as irregular.
Well, I understand this comment, but your original is still unclear to me. You might want to clarify it for others.
I'm interested. Till i read "You need dotnet to run strans." i close my browser tab.
That’s pretty cool. I guess Excels flash fill uses the same engine?

Would like to see more examples than First Middle Last.

I am not sure which implementation Excel uses under the hood -- Excel's flash fill feature has been there for quite some time; PROSE (which strans uses) has not, and Excel is not listed in its impact section. So this seems to hint at the fact that the engine Excel uses is different. Anyhow, the idea behind both definitely comes from the same team, and Sumit Gulwani in particular.
Oh wow. I've learned about Excel's Flash Fill only recently and wasn't even aware that the same thing is available as a library as well.

PowerShell's Convert-String is very rough around the edges, though. Seems more like a proof of concept that ended up slipping into a release.

Yup, perhaps that's why it's missing in the latest PowerShell release ... https://docs.microsoft.com/en-us/powershell/module/Microsoft...
To clarify: Excel FlashFill uses an earlier version of this engine, with a similar but less advanced algorithm. The current engine that powers strans (PROSE) can, for instance, solve the infamous "January" task without errors
Thanks for the explanation. And hi, Alex (cool to meet again here on HN)!
I like that idea!
I think this could use a better title. From the current one, I was expecting a tutorial or a series of learning examples for using sed.
Oh, I now see the ambiguity you refer to. What about this:

Strans – an alternative to sed that automatically learns from examples, instead of having to program yourself

Unfortunately, I can't change the title anymore

I think you can mail "hn@ycombinator.com" for title change. You might also ask for their input.

Strans – sed alternative that automatically learns a string-transformation from an example

Strans - auto text manipulation from sample input-output

sed without the obscure part

We've changed it above. Happy to change again if you prefer (it just needs to be 80 chars or less).
That’s much better.
Agreed. Instead, it’s more of a text manipulation by example.