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

crazyhorse

v0.0.8

Published

This module takes sentences and remixes them into a different semi-coherent sentence.

Downloads

11

Readme

crazyhorse

NPM

In your project's root directory use:

npm install crazyhorse

Usage:

Crazy horse will be one function call. It will take an array of sentence strings or a single string of sentences (I delimit/separate them with '. ' within the string).


var crazyhorse = require('crazyhorse')

crazyhorse(list_of_sentences, function(remixed_sentence){
	
	console.log(remixed_sentence)
})

We wil produce simple sentences at first of form [Noun Phrase][Verb Phrase].

Ideally eventually we will have a sentence structure and grammar like so:

Sentence structure produced by crazyhorse:

[Interjection]||[CurseWord],[Sentence][Random Final Punctuation]
						   	[Noun Phrase] [Verb Phrase]
										  [Verb][NounPhrase]
										  	    [NounPhrase][Sentence]
										  				    [Noun Phrase][Verb Phrase]

Simple Grammar:

[Noun Phrase] : [Article][Adjective || Adverb][Noun] || [Possesive][Noun || ProperNoun]
[Verb Phrase] : [Verb][NounPhrase]
[Sentence]    : [Preposition][Sentence] || [Noun Phrase][Verb Phrase]

Test sentence list to be used as a list of sentences:

var list_of_sentences = "Water polo, or Water ball, is a team water sport. The playing team consists of six field players and one goalkeeper. The winner of the game is the team that scores the most goals. Game play involves swimming, treading water (using a sort of kicking motion known as 'eggbeater kick'), players passing the ball while being defended by opponents, and scoring by throwing the ball into a net defended by a goalie. 'Man-up' (or 'power play') situations occur frequently. Water polo, therefore, has strong similarities to the land-based game of team handball.The White House says now is not the time for Congress to get involved on Iran. When you skydive you have a backup altimeter that will deploy the chute at 1000 feet. All things normal, you'll live but have a rough landing if you are unconscious. The dangerous parts are what obstacles are there. You don't jump directly over the landing zone. You fly to it under canopy with the winds. Without guidance, thing like that river become deadly for an unconscious skydiver. It is also all over in today's Championship game as goals from Bradley Johnson and Lewis Grabban secure Norwich a league double over local rivals Ipswich. College admission season ignites deep anxieties for Asian American families, who spend more than any other demographic on education. At elite universities across the U.S., Asian Americans form a larger share of the student body than they do of the population as a whole. And increasingly they have turned against affirmative action policies that could alter those ratios, and accuse admissions committees of discriminating against Asian American applicants. Last year, a rumor that Harvard University would stop accepting any more Asian American students from San Marino High School spread like a trending hashtag. Just 12 hours ago, I posted a brief piece about the continuing Europtechnopanic in Germany and the effort of publishers there to blame their every trouble on Google—even the so-called sin of free content and the price of metaphoric wurst. Tomorrowland: In Silicon Valley, a new elite doesn’t just want to determine what we consume but how we live. They want to change the world and accept no regulation. Must we stop them?  It is nothing less than prewar propaganda, trying to stir up a populace against a boogeyman enemy in hopes of goading politicians to action to stop these people. If anyone would know better, you’d think they would. Schade."

Ramblings:

So one function well need to have is the ability to remember where words came from after they've been mixed.

In otherwords save an array with references to the original tweet.

The selection of words process should not be totally random. We should allow users to place weights on different tags returned by pos node module. This also lends itself well to machine learning in the future. Basically the wrong part of speech will never replace the wrong one( even if the right one has a 0 weight) but in a sentence where either could be used the part tag with higher weight will supercede.

POS tags:

CC Coord Conjuncn           and,but,or
CD Cardinal number          one,two
DT Determiner               the,some
EX Existential there        there
FW Foreign Word             mon dieu
IN Preposition              of,in,by
JJ Adjective                big
JJR Adj., comparative       bigger
JJS Adj., superlative       biggest
LS List item marker         1,One
MD Modal                    can,should
NN Noun, sing. or mass      dog
NNP Proper noun, sing.      Edinburgh
NNPS Proper noun, plural    Smiths
NNS Noun, plural            dogs
POS Possessive ending       's
PDT Predeterminer           all, both
PP$ Possessive pronoun      my,one's
PRP Personal pronoun         I,you,she
RB Adverb                   quickly
RBR Adverb, comparative     faster
RBS Adverb, superlative     fastest
RP Particle                 up,off
SYM Symbol                  +,%,&
TO 'to'                     to
UH Interjection             oh, oops
VB verb, base form          eat
VBD verb, past tense        ate
VBG verb, gerund            eating
VBN verb, past part         eaten
VBP Verb, present           eat
VBZ Verb, present           eats
WDT Wh-determiner           which,that
WP Wh pronoun               who,what
WP$ Possessive-Wh           whose
WRB Wh-adverb               how,where
, Comma                     ,
. Sent-final punct          . ! ?
: Mid-sent punct.           : ; "
$ Dollar sign               $
# Pound sign                #
" quote                     "
( Left paren                (
) Right paren               )

Structure of the Buckets:

{
	"CC":["and", "or", "but"],
	.
	.
	.
	"DT":["the", "some"],
	"NN":["dog", "cat", "frog"],
	"NNP":["Edinburgh", "Jack"],
	.
	.
	.
}

Nitpicked the most impactful curse words from:

https://github.com/reimertz/curse-words