@jajoosam/

FluidShockedBoard

Nodejs

No description

fork
loading
Files
  • index.js
  • package-lock.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var rhyme = require('rhyme');
let dict = {}
let text = `Hi, kids, do you like violence? (Yeah, yeah, yeah)
Wanna see me stick Nine Inch Nails through each one of my eyelids? (Uh-huh)
Wanna copy me and do exactly like I did? (Yeah, yeah)
Try 'cid and get fucked up worse than my life is? (Huh?)
My brain's dead weight, I'm tryna get my head straight
But I can't figure out which Spice Girl I want to impregnate (Oh)
And Dr. Dre said, "Slim Shady, you a basehead" (Uh-uh)
"Then why's your face red? Man, you wasted"
Well, since age twelve, I felt like I'm someone else
'Cause I hung my original self from the top bunk with a belt
Got pissed off and ripped Pamela Lee's tits off
And smacked her so hard I knocked her clothes backwards like Kris Kross
I smoke a fat pound of grass, and fall on my ass
Faster than a fat bitch who sat down too fast
Come here, slut; "Shady, wait a minute, that's my girl, dawg"
I don't give a fuck, God sent me to piss the world off`;

let parseText = text.split('\n').map(e => e.split(' '));

rhyme(function (r) {
    for(var i = 0; i<parseText.length; i++){
      for(var j = 0; j<parseText[i].length; j++){
        let word = parseText[i][j];
        if(word){
          let p = r.pronounce(word);
          if(p){
            if(!dict[`${p[0][p.length]}`]){
              dict[`${p[0][p.length]}`] = []
            }
            console.log(p)
            // if(p.length > 1){
              dict[`${p[0][p.length]}`].push(parseText[i][j]);
            // }
          }
        }
      }
      //console.log(JSON.stringify(dict, null, 2))
    }
});

node v10.16.0