Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Rant, a procedural text generation language (github.com/theberkin)
155 points by atlantique on Dec 7, 2014 | hide | past | favorite | 36 comments



I think this is how Peyton Manning chooses his audibles. <midwest-city> <soup-brand> <num:1:200>!


Looks like an advanced version of "spintax"[0], which is popular amongst seo blackhatters. I could certainly see this as a replacement.

[0] http://umstrategies.com/what-is-spintax/


This is really cool, I had been working on something similar.

I do think it's a little 'pejorative' to try to computationally define creativity, though.

Creativity seems to involve so many levels of cognition, and it really seems like you can automate it, describe it, or define it.

But as soon as you seem to define it methodically, and think you've got it, it changes in a way you can't anticipate, but which draws you into it with this force you can't ignore or escape. It's incredibly frustrating, but it's also very human.


Sorry, newbie here. Is there some sort of way to keep a reference to a generated term? For example if I generated the name "Mike" and wanted to use that same name several times.


Absolutely! Try this out: <name::=a>, <name::=b>, <name::=a>, <name::=b>

This is called a match carrier. https://github.com/TheBerkin/Rant/wiki/Query-carriers


Very cool! I attempted a very primitive version of this for generating band names[1]. Now I'm tempted to port it to Rant :) One bit of advice though - the "getting started" section could be a bit more helpful for new users... it should at least mention the language it's written in (C#)!

[1] https://github.com/dandelany/band-name/blob/master/templates...


Hey! Your comment was a little vague in what you wanted, but we wrote a little extra documentation. Let us know if it's not what you needed. https://github.com/TheBerkin/Rant/wiki/Getting-started



Does it work on Linux?


Yes!


Thanks. I asked because it's written in C#.


What are some real world applications which use this approach of text generation?


Well, they say that naming things is one of the hard problems in CS, right? Use this to generate names for all your functions/classes/variables. Just preprocess your source code before you compile!


Procedural content generation in computer games.


I think these languages for generating data are really useful. There is one called Protodata (https://github.com/evincarofautumn/protodata) for generating binary data. From the README: "Protodata is a language for describing binary data, originally written for prototyping and reverse engineering binary file formats. It is particularly useful for generating annotated data in a custom format, without having to write custom editing tools."


This reminds me of polygen[1,2] that I discovered among the many programs packaged for Debian... but looks at least in some ways friendlier. Is it very limited/tailored/specialized for English?

[1] https://github.com/Enucatl/polygen [2} https://www.polygen.org [Mostly in Italian. I seem to recall there was a section in English ... but if there is I can't find any more]


I've made a similar project about two years ago in Python, called Choice Words [1]. I've had some really interesting results by encoding the grammar of SVG, which generates procedural drawings (the GitHub project shows an example).

My project was based on the Kant Generator, an example project from Dive Into Python[2].

[1] https://github.com/fdb/choicewords

[2] http://www.diveintopython.net/


Very cool.

I just wish I wasn't so certain that the developers of spamming tools will rip this off with shrieks of glee and use it to stuff our inboxes with yet more junk.


Or to spam disqus comments on various sites. I always see similar spam bots with comments like "I agree with bob here. Let me also mention a great way to make 895 dollars a day from home".

Also more on topic I could see Rant being helpful for online language lessons or something. I remember exercises in grammar school where you would have to identify parts of a sentence(ex: possessive pronouns, transitive verbs, etc). I think it would be fairly easy to use Rant to generate unique questions for each student. Not sure how practical or useful that actually is, but it could be fun to make.


Bit too complicated for them, really.


Interesting tool. I can't help but wonder if it could be used as a way to resist forensic linguistics.


Maybe not bad, definitely has few very cool features (rhymes impressed me), but I'm struggling to imagine when I'd actually need to use it. Sometimes I do need some random natural language text for testing, but then I usually just copy something from wikipedia or some book and it's guaranteed to be more random and more natural than anything I'd generate myself. No, hardly I'll ever need to generate natural-language sentences using this. Generating something more primitive, like random IPs? Well, if I need few I hardly would struggle to remember syntax (or even name) of some tool I downloaded long time ago and never used since, or I need many structured data of some sort and then it's almost certain that using this DSL wouldn't be enough or simply practical, and I'd end up using Python (which already has libraries for generating random data anyway).

Edit: to guys who are actively minusing this comment, I would be grateful if somebody could actually suggest any use case.


I think people are downvoting you because you're post reads something like, "This is neat, but useless and it's been done before."

Fwiw I didn't downvote you, but it'd probably be taken better if you just said something like, "This is really interesting. I'm not sure what I'd use it for personally, but I'm interested in knowing if you had specific use cases in mind, and what sorts of projects are you seeing it be used in now?"

For me, it looks like it'd be handy to use to generate test data and/or to make fun/weird little game apps, but still be able to keep everything in a .net language, since I work for a .net shop. (I could use python or whatever I want, really. we're flexible. it's just nice to keep things uniform)


Being someone who wants to build something like this: there are plenty of uses that can build on top of text that is readable or meaningful. If you can get a computer to have a random conversation with itself, then that is very interesting.


I find the .gitignore a good way to gauge the quality of a repo. This one does not exhibit quality.


What criteria do you use to assess "quality"? In any case, this .gitignore is almost entirely the standard GitHub setup for Visual Studio projects.

https://github.com/github/gitignore/blob/master/VisualStudio...


Well, that's a knock on /github then. The entries should be as minimal as possible, in number and in individual length.


What exactly do you think this .gitignore is lacking?


Quite the opposite of "lacking"--way too much.


I'm seeing a lot of people in comments talking about how they wrote something similar or other tools exist. Can someone explain their use cases that don't involce SEO or some other kind of thing that's "bad"?


Very nice tool, thanks. Where can i find a documentation or a list of commands?


Rant is very well documented and it can be found on the GitHub wiki. Here's a link! https://github.com/TheBerkin/Rant/wiki


One place I can see this really shining is as part of a script that generates fixtures for Django apps.


Fascinating - I've just written one of these for a project in Go.


Could this be used in reverse to match text?


Very fun!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: