Skip to content

Instantly share code, notes, and snippets.

View hospadar's full-sized avatar

Luke Hospadaruk hospadar

View GitHub Profile
@hospadar
hospadar / generate_ngrams.py
Created February 25, 2015 20:08
DFR Tokenizer example
from __future__ import print_function
import re, sys
from nltk import ngrams, tokenize, download
from argparse import ArgumentParser
"""
#USAGE:
#This python file illustrates the techniques that Data For Research (http://dfr.jstor.org/) uses to tokenize raw text and generate n-grams
#DFR uses the NLTK 'punkt' tokenizer which needs to be downloaded separately from the nltk package.
@hospadar
hospadar / counter.py
Created November 25, 2014 03:57
Python script to count keypresses. Used for winding pickups.
from __future__ import print_function
import sys, time
from collections import deque
import curses, traceback
'''
Simple counter script
Originally used for counting pickup windings for an electric violin pickup.
Of course it would work well for any pickup winding activity.