Skip to content

Instantly share code, notes, and snippets.

@pmrozik
pmrozik / detect_pp.py
Created August 5, 2015 11:20
Present Perfect Detector
# Present Perfect Detector
# Written by Pawel Mrozik
import re
import time
from sets import Set
start_time = time.time()
past_participles = []
// WordStatistics.java
import java.util.*;
import java.io.*;
import java.util.regex.*;
enum Pronoun
{
I ("I"),
YOU ("you"),
SHE ("she"),
@pmrozik
pmrozik / Play.cs
Last active August 29, 2015 14:26
Play method for WordUp
private void Play(GameTime gameTime)
{
// Allows user to enter words
KeyboardState keyboard = Keyboard.GetState();
char pressedChar = KeyboardProcessor.GetLetter(keyboard);
if (pressedChar != ' ')
{
// Check whether the letter is one of the falling ones
if (currentWord.Contains(pressedChar.ToString()))
public static void insertWord(string word)
{
OperationDataContext odContext = new OperationDataContext();
english_dictionary dictionary = new english_dictionary();
dictionary.word = word;
dictionary.wordID = wordID++;
odContext.english_dictionaries.InsertOnSubmit(dictionary);
odContext.SubmitChanges();
@pmrozik
pmrozik / gist:98afa8e0b59910049806
Last active August 29, 2015 14:13
insertWords method
// Put all the words from the dictionary file in the database
public static void insertWords(List<string> wordList)
{
OperationDataContext odContext = new OperationDataContext();
int wordID = 0;
foreach (string word in wordList)
{
english_dictionary dictionary = new english_dictionary();