Skip to content

Instantly share code, notes, and snippets.

@Ghost---Shadow
Ghost---Shadow / plag.py
Created December 11, 2015 05:01
Using NLTK to replace all words in a string with their synonyms.
from nltk.corpus import wordnet
from nltk.tokenize import word_tokenize
from random import randint
import nltk.data
# Load a text file if required
text = "Pete ate a large cake. Sam has a big mouth."
output = ""
# Load the pretrained neural net
@hubgit
hubgit / background.js
Last active September 27, 2021 14:17
Chrome extension to block common third-party background requests
var urls = [
'*://graph.facebook.com/*',
'*://platform.twitter.com/*',
'*://*.google-analytics.com/*'
];
var response = function() {
return { cancel: true };
}