Skip to content

Instantly share code, notes, and snippets.

View Riuchando's full-sized avatar
🤠
programming

Stephen Kinser Riuchando

🤠
programming
View GitHub Profile
from nltk.corpus import wordnet as wn
from sets import Set
def wordlist(word):
t=Set([])
for word in wn.synsets(word):
for syn in word.lemma_names():
t.add(syn.lower())
for hypo in word.hyponyms() :
#t.append(hypo.lemmas_name())
@Riuchando
Riuchando / keming.py
Created May 28, 2016 22:46
simple program that randomizes the spacing of a sentence so that it becomes harder for the reader to read
import random
def randomchunk(lst,chunknum):
total=len(lst)
#take the even chunksize and given a normal distribution
#it seems that a normal coeffecient of variation would be 0.47,
#so with the random choices let it be the "mean" + or - 0.47* mean, if the - is <1, let it be one
chunkVariaton=0.47*(float(total)/chunknum)
high=int((float(total)/chunknum)+ chunkVariaton)
low=int((float(total)/chunknum)- chunkVariaton)
if low < 1:
@Riuchando
Riuchando / keming.py
Created May 28, 2016 22:46
simple program that randomizes the spacing of a sentence so that it becomes harder for the reader to read
import random
def randomchunk(lst,chunknum):
total=len(lst)
#take the even chunksize and given a normal distribution
#it seems that a normal coeffecient of variation would be 0.47,
#so with the random choices let it be the "mean" + or - 0.47* mean, if the - is <1, let it be one
chunkVariaton=0.47*(float(total)/chunknum)
high=int((float(total)/chunknum)+ chunkVariaton)
low=int((float(total)/chunknum)- chunkVariaton)
if low < 1:
@Riuchando
Riuchando / minus.cpp
Last active December 29, 2015 03:29
Only using +, implement minus
#include <iostream>
int minus(int lhs, int rhs);
int main(){
std::cout<<minus(-4,1)<<'\n';
std::cout<<minus(4,1)<<'\n';
std::cout<<minus(4,-1)<<'\n';
std::cout<<minus(-4,-1)<<'\n';
return 0;
}