Skip to content

Instantly share code, notes, and snippets.

View jromeem's full-sized avatar
🍰
Eating cake

Jerome Martinez jromeem

🍰
Eating cake
View GitHub Profile
@jromeem
jromeem / ngrams.py
Created August 22, 2012 22:18
In the fields of computational linguistics and probability, an n-gram is a contiguous sequence of n items from a given sequence of text or speech. --wiki
# Jerome Martinez
# N-Gram parser
# November, 10, 2011
# run through command line:
# arguments: <input_file_name> <output_file_name> <n-gram_count>
# (optional) arguments: <input_file_name> --verbose <n-gram_count>
# outputs the n-gram as a dictionary
# of keys and values where the key
@jromeem
jromeem / Search.py
Last active October 9, 2015 03:18
I written the search functionality for our world crisis database
from pprint import pprint
import re, sys, unicodedata
from django.utils import simplejson
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from DataModels import Crisis, Organization, Person
class SearchResults(webapp.RequestHandler):
def get(self):
@jromeem
jromeem / graph1.pas
Created August 4, 2012 06:29
output to compiler-- intermediate code for a Pascal program
(program graph1 (progn output)
(progn (:= i 0)
(label 1)
(if (<= i 32)
(progn (:= x (* 6.250000e-02
(float i)))
(:= y (* (funcall exp (- x))
(funcall sin (* 6.283180e+00
x))))
(:= n (+ (funcall round (* 3.200000e+01