npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fast-ish-markov

v1.0.2

Published

fast-ish-markov ----------------

Downloads

5

Readme

fast-ish-markov

:car: a decently fast and synchronous markov for when u just need some garbage text

MARKOV TIPS

  • cleanup yr own dang lines yrself! lowercase, splitting-on/removing line-ending punctuation, etc.
  • best effects gained if u "rate" the output somehow. i.e, generate a thousand lines, run them through some algorithm that returns a "score"
    • u know like, maybe u keep generating markov lines OVER AND OVER until u find ones that rhyme?
    • or maybe u do POS analysis on a known text and generate markov lines till u have a match?
    • get wild!
  • a wordfilter is also recommeneded. dariusk/wordfilter, jimkang/iscool, or coleww/this-is-probably-ok-to-say are all good choices.
  • another neat trick is to check the markov output against the source lines with a levehnstein distance thing, to make sure it's not just repeating "real text"
  • hey! since u already have this garbled text, why not run it through further text processors? word-vomit, poetic-vomit, diacriticize, new-slang, to-unicode, etc.
  • make multiple chains and have them dip into each other. if u provide a large num, the chain will run till it hits a stop, at which point u slice off the last n words and try another chain. Mixing a ton of corpuses isn't always advisable, but having several chains that each mix a few corpii and each flow into one another might be more interestinger.
  • use markovs as a component in a template, i.e, only generate short bursts of words based on keys for a template. "and they said '{generate some stuff}' and so on and so on etc."
  • only seed the markov with lines of a known format, i.e, "I WISH I WAS A _____________", then u can fill based on "I WISH" and let the pseudo-magic flourish

NPM js-standard-style Build Status

EXAMPLE

var markov = require('fast-ish-markov')
var m = markov(["i like cats", "i like dogs"], 2)
m.fill(m.pick(), 3)
// will be either "i like cats" or "i like dogs". yay probability!