How to use the rita.RiTa function in rita

To help you get started, we’ve selected a few rita examples, based on popular ways it is used in public projects.

github airhadoken / wedidntstartthefire / app.js View on Github external
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(" ");
}
github dariusk / sorting-bot / index.js View on Github external
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];
};
github handav / twitter-bots / 12-audiobot / index.js View on Github external
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);
}
github handav / twitter-bots / 12-audiobot / index.js View on Github external
function getPartsOfSpeech(text){
    return rita.RiTa.getPosTags(text);
}
github spences10 / twitter-bot-playground / src / markov-bot.js View on Github external
function cleanText(text) {
  return rita.RiTa.tokenize(text, ' ')
    .filter(hasNoStopWords)
    .join(' ')
    .trim()
}
github airhadoken / wedidntstartthefire / app.js View on Github external
//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",

rita

tools for generative natural language

GPL-3.0
Latest version published 14 days ago

Package Health Score

70 / 100
Full package analysis