4 ms·
Show HN: Strans – Sed alternative that automatically learns from examples
- fooblat 8y agoI 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.
- ianai 8y agoAgreed. Instead, it’s more of a text manipulation by example.
- inventitech 8y agoOh, 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
- maxxxxx 8y agoThat’s much better.
- O_H_E 8y agoI 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
- dang 8y agoWe've changed it above. Happy to change again if you prefer (it just needs to be 80 chars or less).
- lysium 8y agoThat’s pretty cool. I guess Excels flash fill uses the same engine? Would like to see more examples than First Middle Last.
- inventitech 8y agoI 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.
- ygra 8y agoOh 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.
- inventitech 8y agoYup, perhaps that's why it's missing in the latest PowerShell release ... https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Convert-String?view=powershell-5.1&viewFallbackFrom=powershell-6 https://docs.microsoft.com/en-us/powershell/module/Microsoft...
- apskim 8y agoTo 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
- inventitech 8y agoThanks for the explanation. And hi, Alex (cool to meet again here on HN)!
- lysium 8y agoI like that idea!
- dopylitty 8y agoThis is a good article to come up in Maruary or Apruary.
- O_H_E 8y agoDoes that refers for the months of March and April???
- rgoulter 8y agoJan -> 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.
- O_H_E 8y agoWell, I understand this comment, but your original is still unclear to me. You might want to clarify it for others.
- projectramo 8y agoSo 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.
- solarized 8y agoI'm interested. Till i read "You need dotnet to run strans." i close my browser tab.