add markov-chain-based tech generator - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 797a554e1506581b04f9164496fd1e561a6e20ce DIR parent 08d99143ea5968f2bccae021d98dc92b71fc8a90 HTML Author: KatolaZ <katolaz@freaknet.org> Date: Thu, 8 Aug 2019 20:16:53 +0100 add markov-chain-based tech generator Signed-off-by: Annna Robert-Houdin <annna@bitreich.org> Diffstat: M annna-start-services | 9 +++++++++ A modules/markov_tech/README | 9 +++++++++ A modules/markov_tech/adjectives | 60 +++++++++++++++++++++++++++++++ A modules/markov_tech/copulas | 69 ++++++++++++++++++++++++++++++ A modules/markov_tech/markov | 43 ++++++++++++++++++++++++++++++ A modules/markov_tech/techs | 22 ++++++++++++++++++++++ 6 files changed, 212 insertions(+), 0 deletions(-) --- DIR diff --git a/annna-start-services b/annna-start-services @@ -302,6 +302,8 @@ hashtags="#magic https://www.youtube.com/watch?v=NFQCYpIHLNQ botname="annna" iiroot="/home/annna/irc" iibase="/home/annna/irc/chat.freenode.net" +modbase="/home/annna/modules/" + # Permissions [ -d ${iiroot} ] && chmod o+rx ${iiroot} @@ -488,6 +490,13 @@ then continue; fi + if [ "${text}" = "${botname}, tell me about tech." ]; + then + techstr=$(${modbase}/markov_tech/markov) + annna-say -c "#bitreich-en" "${techstr}" + continue; + fi + randomtag=0 case "${text}" in *\#nospoil*) DIR diff --git a/modules/markov_tech/README b/modules/markov_tech/README @@ -0,0 +1,9 @@ +A simple shell script that implements a generator of technologies +using an unbiased Markov chain. + +The chain produces phrases containing at least two technologies. +Then, the probability to include N technologies with N>2 decreases +as 1/(FREW)^(N-2), where FREQ is a parameter of the script "markov". + +Please check the BASE variable, which should point to the folder where +the script `markov` and the associated files are contained. DIR diff --git a/modules/markov_tech/adjectives b/modules/markov_tech/adjectives @@ -0,0 +1,60 @@ +large-scale +serverless +scalable +integrated +multi-hop +cryptographic +containerized +encrypted +virtualized +optimized +advanced +server-side +client-side +lightweight +intelligent +automatic +self-healing +robust +small-scale +personalized +customized +modern +legacy +redundant +reliable +machine-independent +architecture-independent +portabla +client-specific +architecture-specific +standard +cloud-compliant +cloud-aware +cloud-centric +web-oriented +cluster-enahced +cloud-based +Java-based +Rust-enabled +web-powered +attack-free +authenticated +smart +concurrent +agile +POSIX-compliant +next-generation +NSA-approved +industry-standard +military-grade +Windows-compatible +Android-based +Java-enhanced +low-latency +high-bandwidth +self-compiling +self-reproducing +self-signed +content-aware +protocol-aware DIR diff --git a/modules/markov_tech/copulas b/modules/markov_tech/copulas @@ -0,0 +1,69 @@ +to retrieve +to retrieve +to retrieve +to implement +to develop +to develop +to develop +to develop +to optimize +to optimize +for +for +for +for +for +for +on top of +on top of +on top of +on top of +embedded in +on +on +on +on +on +on +based on +based on +based on +augmenting +serving +deploying +to deploy +over +over +over +to standardize +to standardize +to standardize +to recover +to serve +producing +to deliver +to deliver +delivering +implementing +implementing +implementing +implemented on +implemented on +implemented on +exploiting +exploiting +to augment +to integrate +integrated with +to automate +for intelligent +for intelligent +for automatic +to replace +to replace +to replace +to miniaturize +to miniaturize +to modernize +to modernize +to modernize DIR diff --git a/modules/markov_tech/markov b/modules/markov_tech/markov @@ -0,0 +1,43 @@ +#!/bin/sh + +BASE="/home/annna/modules/markov_tech" + +TECH="${BASE}/techs" +ADJ="${BASE}/adjectives" +COP="${BASE}/copulas" +FREQ=2 + +## function +rand(){ + max="$1" + if [ -z "$max" -o "$max" -lt 1 ]; then + max=2; + fi + r=$(echo "$(od -An -N2 -i /dev/urandom) % $max" | bc) + echo "$r" +} + + +tech1="$(shuf "${TECH}" | head -1)" +tech2="$(shuf "${TECH}" | head -1)" +while [ "$tech1" = "$tech2" ]; do + tech2="$(shuf "${TECH}" | head -1)" +done +adj1="$(shuf "${ADJ}" | head -1)" +adj2="$(shuf "${ADJ}" | head -1)" +while [ "$adj1" = "$adj2" ]; do + adj2="$(shuf "${ADJ}" | head -1)" +done + +cop="$(shuf "${COP}" | head -1)" +res="$adj1 $tech1 $cop $adj2 $tech2" + +a=$(rand $FREQ) +while [ "$a" = 1 ]; do + ntech="$(shuf "${TECH}" | head -1)" + nadj="$(shuf "$ADJ" | head -1)" + ncop="$(shuf "$COP" | head -1)" + res="$res $ncop $nadj $ntech" + a=$(rand $FREQ) +done +echo "$res" DIR diff --git a/modules/markov_tech/techs b/modules/markov_tech/techs @@ -0,0 +1,22 @@ +Hadoop clusters +Google searches +microservices +mongodb infrastructure +IoT devices +swarms +kubernetes +docker farms +containers +virtual machines +rust compilers +AI technologies +blockhain +virtual reality +5G repeaters +cloudware +angular infrastructures +big data problems +javascript engines +machine-learning algorithms +cryptocurrencies +automated devops