Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function makerhymekey(phrase) {
var i;
var speak_phrase = makespeakable(phrase);
var stresses = Rita.RiTa.getStresses(speak_phrase);
stresses = stresses.replace(/[^01]/g, "");
var syllables = Rita.RiTa.getSyllables(speak_phrase).split(/[\/ ]/).reverse();
var num_syllables = ~stresses.lastIndexOf("1") ? (stresses.length - stresses.lastIndexOf("1")) : stresses.length;
return syllables.slice(0, num_syllables).map(function(syll) {
return syll.replace(/^[^aeiou]*/, "");
}).join(" ");
}
var _ = require('underscore');
var Twit = require('twit');
var T = new Twit(require('./config.js'));
var wordfilter = require('wordfilter');
var rita = require('rita');
var lexicon = new rita.RiLexicon();
var r = rita.RiTa;
var corpora = require('corpora-project');
var animals = require('./animals.js');//corpora.getFile('animals','common').animals;
var bodyParts = require('./bodyParts.js');
var redis = require('redis'), client = redis.createClient();
wordfilter.addWords(['rape']);
Array.prototype.pick = function() {
return this[Math.floor(Math.random()*this.length)];
};
Array.prototype.pickRemove = function() {
var index = Math.floor(Math.random()*this.length);
return this.splice(index,1)[0];
};
var _ = require('underscore');
var Twit = require('twit');
var T = new Twit(require('./config.js'));
var wordfilter = require('wordfilter');
var rita = require('rita');
var lexicon = new rita.RiLexicon();
var r = rita.RiTa;
var corpora = require('corpora-project');
var animals = require('./animals.js');//corpora.getFile('animals','common').animals;
var bodyParts = require('./bodyParts.js');
var redis = require('redis'), client = redis.createClient();
wordfilter.addWords(['rape']);
Array.prototype.pick = function() {
return this[Math.floor(Math.random()*this.length)];
};
Array.prototype.pickRemove = function() {
var index = Math.floor(Math.random()*this.length);
return this.splice(index,1)[0];
};
.on('end', () => {
const markov = new rita.RiMarkov(20)
markov.loadText(inputText)
const sentence = markov.generateSentences(1)
.toString()
.substring(0, 140)
bot.post('statuses/update', {
status: sentence
}, (err, data, response) => {
if (err) {
console.log(err)
} else {
console.log('Markov status tweeted!', sentence)
}
})
})
}
function createMidi(tweet, midiFn, cb){
var file = new midi.File();
var track = new midi.Track();
file.addTrack(track);
var cleanedText = rita.RiTa
.tokenize(cleanText(tweet.text))
.filter(isNotPunctuation)
.join(' ');
var taggedTweet = getPartsOfSpeech(cleanedText);
compose(taggedTweet, track);
fs.writeFile(midiFn, file.toBytes(), {encoding: 'binary'}, cb);
}
function getPartsOfSpeech(text){
return rita.RiTa.getPosTags(text);
}
function cleanText(text) {
return rita.RiTa.tokenize(text, ' ')
.filter(hasNoStopWords)
.join(' ')
.trim()
}
//var Rhyme = require("rhyme");
var Rita = require("rita");
var n2w = require("number-to-words");
Rita.RiTa.SILENT = true;
var https = require("https");
var MongoClient = require('mongodb').MongoClient;
var Q = require("q");
var Twit = require("twit");
var config = require("./config.json");
var say_letter = {
A: "ay",
B: "bee",
C: "see",
D: "dee",
E: "ee",
F: "eff",
G: "gee",
H: "aitch",