nerdculture.de is one of the many independent Mastodon servers you can use to participate in the fediverse.
Be excellent to each other, live humanism, no nazis, no hate speech. Not only for nerds, but the domain is somewhat cool. ;) No bots in general. Languages: DE, EN, FR, NL, ES, IT

Administered by:

Server stats:

1.1K
active users

#ngram

0 posts0 participants0 posts today

#HowToThing #030 — Procedural, rule-based & stochastic text generation using a custom DSL, parse grammar (via thi.ng/parse) and abstract syntax tree transformation (via thi.ng/defmulti).

Since it's #NaNoWriMo & #NaNoGenMo [1], I'm closing out this first season of 30 #HowToThing's with a related topic & maybe someone even finds it useful/interesting... 😉🤷‍♂️

This example is in principle inspired by @galaxykate's oldie & goodie #Tracery, but is using a super simple custom text format instead of JSON to define variables and template text. Variables are expanded recursively and I've also added features like dynamic, indirect pointer-like variable lookups to derive variables based on current values (useful for conditionals & context-specific expansions), hidden assignments, chainable modifiers... I've included 5 different "story" templates (incl. comments) showing various features. Just press "regenerate" to create new random variations...

Similar to the previous #HowToThing, I'm hoping this example also shows that approaching use cases like this via small domain-specific languages with proper grammar rules, does not require much ceremony and is often more amenable to change during prototyping (and later also more maintainable!) than just regex bashing approaches...

The parser grammar itself is explained in the thi.ng/parse readme. As usual, the grammar was created/prototyped with the Parser Playground[2], which we developed from scratch during the first thi.ng livestream[3] (2.5h video)...

Demo (example project #145):
demo.thi.ng/umbrella/procedura

Source code:
github.com/thi-ng/umbrella/tre

If you have any questions about this topic or the packages used here, please reply in thread or use the discussion forum (or issue tracker):

github.com/thi-ng/umbrella/dis

[1] github.com/NaNoGenMo/2023/
[2] demo.thi.ng/umbrella/parse-pla
[3] youtube.com/watch?v=mXp92s_VP4

A fun thing to do is enter your name in the amazing Ngram Viewer. Mine looks like this. The peak is explained, I presume, by the misfortunes of a gentleman who ran into a spot of bother in Spain. My other namesakes have failed in much less heroic ways. Don’t like the look of the graph, though. Seems we’re dying off as fast as butterflies in the UK
(Google Ngram charts word frequencies from a large corpus of books that were printed between 1500 and 2019) #history #language #Ngram

My son told me today that he loves the word "peckish", so we talked about #word frequency, and tried to find a common (non-specialized) word that is is less frequent than "peckish". Mostly failed.

But what draw my attention is how all of the words we thought of raised in popularity after 2000, on Google #ngram. Why? What happened in 1960-1980 that drove them down? Or is GN corpus skewed (towards patents and academic papers?) during this era?