8 ms·
Show HN: Rant, a procedural text generation language
- personjerry 12y agoSorry, 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.
- atlantique 12y agoAbsolutely! 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 https://github.com/TheBerkin/Rant/wiki/Query-carriers
- dsplatonov 12y agoVery nice tool, thanks. Where can i find a documentation or a list of commands?
- atlantique 12y agoRant is very well documented and it can be found on the GitHub wiki. Here's a link! https://github.com/TheBerkin/Rant/wiki https://github.com/TheBerkin/Rant/wiki
- dandelany 12y agoVery 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/templates.js https://github.com/dandelany/band-name/blob/master/templates...
- atlantique 12y agoHey! 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 https://github.com/TheBerkin/Rant/wiki/Getting-started
- e12e 12y agoYou might also like this polygen grammar: http://www.polygen.org/it/grammatiche/musica_cinema_e_spettacolo/eng/metal.grm http://www.polygen.org/it/grammatiche/musica_cinema_e_spetta...
- listic 12y agoDoes it work on Linux?
- atlantique 12y agoYes!
- listic 12y agoThanks. I asked because it's written in C#.
- chillzilla 12y agoVery fun!
- sloanesturz 12y agoI think this is how Peyton Manning chooses his audibles. <midwest-city> <soup-brand> <num:1:200>!
- krick 12y agoMaybe 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.
- drcomputer 12y agoBeing 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.
- doorhammer 12y agoI 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)
- e12e 12y agoThis 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 https://github.com/Enucatl/polygen [2} https://www.polygen.org 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]
- cstross 12y agoVery 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.
- aaronem 12y agoBit too complicated for them, really.
- ssully 12y agoOr 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.
- fdb 12y agoI'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 https://github.com/fdb/choicewords [2] http://www.diveintopython.net/ http://www.diveintopython.net/
- RexRollman 12y agoInteresting tool. I can't help but wonder if it could be used as a way to resist forensic linguistics.
- drcomputer 12y agoThis 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.
- aton 12y agoWhat are some real world applications which use this approach of text generation?
- untothebreach 12y agoWell, 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!
- webwarrior 12y agoProcedural content generation in computer games.
- troels 12y agoLooks 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/ http://umstrategies.com/what-is-spintax/
- sambeau 12y agoFascinating - I've just written one of these for a project in Go.
- jdp 12y agoI think these languages for generating data are really useful. There is one called Protodata (https://github.com/evincarofautumn/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."
- Pinn2 12y agoI find the .gitignore a good way to gauge the quality of a repo. This one does not exhibit quality.
- djur 12y agoWhat 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.gitignore https://github.com/github/gitignore/blob/master/VisualStudio...
- Pinn2 12y agoWell, that's a knock on /github then. The entries should be as minimal as possible, in number and in individual length.
- scott_karana 12y agoWhat exactly do you think this .gitignore is lacking?
- Pinn2 12y agoQuite the opposite of "lacking"--way too much.
- Houshalter 12y agoCould this be used in reverse to match text?
- azinman2 12y agoI'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"?
- kagia 12y agoOne place I can see this really shining is as part of a script that generates fixtures for Django apps.