Hacker News new | past | comments | ask | show | jobs | submit login
Rant – An all-purpose procedural text engine (github.com/theberkin)
302 points by sansnomme on Feb 8, 2019 | hide | past | favorite | 33 comments



I was expecting to find a reference in the comments to Baba https://github.com/Lokaltog/baba-core#readme and its [in]famous example https://git-man-page-generator.lokaltog.net



This would be a cool addon into a Unity C# game, easily spin up some procedural dialog by NPCs, have some rhyming characters, spit out some 'clues' in their rhymes then save those as text variables and store them in the environments puzzle as solution pieces. Kind of dehumanizing though for the game, like sucking out the soul.


That's the way the heart of games like Event[0] or Façade works.


This is really a fun library to play with! :)

I've just written a little post about using Rant in Python if someone doesn't want to go into C#.

https://kleiber.me/blog/2019/02/08/quick-tip-text-generation...


Excellent post, I was looking for something in python.


Reminds me of polygen (Italian) https://polygen.org/it/manuale


I'm reading the replies here trying to ID the one generated by Rant.


Really neat. This is something I wouldn’t even know to look for as a library.


Nice! Let’s write some Twitter bots with that...


I made a random sentence generator in Python about 10 years ago. It doesn't have any kind of pattern control (totally random), but it has different lists of nouns, verbs, adjectives, etc, and outputs grammatically correct sentences. I might steal some ideas from this, if I ever get around to working on it again.


I've looked for this and never found the right search term. Nice!

Likewise, I can't identify the search terms to find a library for extracting data from a text corpus - e.g. to identify addresses, dates, names, phone numbers. Does one exist?

I've smashed together a few regular expressions to brute-force it, but the accuracy is very low.


Loosely you're talking about named entity recognition/extraction (strictly you might not include addresses etc under this definition who but who cares). You might get some mileage out of tools like:

https://nlp.stanford.edu/software/CRF-NER.shtml


Stanford NER is very powerful. If you dont want to mess around with Java, there are also Python libraries that do this very effectively and easier to get started on (e.g. NLTK or Spacy). A high level intro for both with code snippets - https://towardsdatascience.com/named-entity-recognition-with...


This looks great! Is there anything similar available in other languages?

BTW if the author is about, there's a broken link at the bottom of the homepage, to https://berkin.me/rantdocs


There's a few natural language generation frameworks out there. I came across this one for Java a few years ago:

https://github.com/simplenlg/simplenlg


Fixed. Thanks for pointing it out.


How I wish this was in C.


could ahead of time compile it to a native dll and pretend


Oh? Friend, may you link me to wherever I can learn more about this? I wanted this in C, so that I could bind it to Crystal [1].

[1]: https://crystal-lang.org


Funnily enough, there was a procedural text generation system in Cambridge (Phoenix) back in the day called... RANT.

There was also one called TOAD which was more venerable and popular. Anyone posting word salad was inevitably accused of using TOAD’s output.


I used this a while back when I was researching a way to help people with macular degeneration. I'd created some visual distortions which could be applied to a VR headset (if you had eye-tracking information) which I hoped would improve reading ability in MD patients. I used Rant to generate some random text in Unity and then measured how reading speed varied.


Rant dev here-- Wow! This has to be the most interesting use case I've heard of in a while.


This reminds me of an unrelated C program called "rant" from 30+ years ago:

https://grack.com/code/legacy/rant/rant.c


Sounds like a fun personal project, but looks like another esoteric language no one will use.


Download link on website busted for me. Hugged to death? Getting BlobNotFound.


It's just a rabbit!

> It has been refined to include a dizzying array of features...

RUN AWAY!


this is a topic related to spintext, which is a technique for spam-filter avoidance.


But, why?


This is the most hilarious package. Can't wait to try it out!


AAaaaaand it still looks like a machine code, not human readable code:

[rs:10;\s]{[rn]. - what is this?

::&a> ?? what is a? what is $?


Hi, most of this is shorthand for either several functions or functions with longer names. For example, [rs:10;\s] is the same as [rep:10][sep:\s].

The last example is used to synchronize results between dictionary queries. This particular one is short for "output the same word as any other query to this table with the match ID 'a'."

In retrospect it was a poor decision to use shorthand forms in prominent example snippets, and I'll consider revising them.


I was bored of regular expressions anyway




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

Search: