This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GORP Tester | |
require 'open3' | |
require 'tmpdir' | |
unless ARGV.length >= 2 | |
$stderr.puts "usage: path_to_compilerFramework path_to_test_files_or_directory" | |
exit | |
end | |
tests = if ARGV.length == 2 && File.directory?(ARGV[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'iconv' | |
def content_to_xml(context) | |
"<context number=\"#{context[:number]}\"> | |
<city>#{context[:city]}</city> | |
<state>#{context[:state]}</state> | |
<lat>#{context[:lat]}</lat> | |
<long>#{context[:long]}</long> | |
<day>#{context[:day]}</day> | |
<time>#{context[:time]}</time> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(Prototype) { | |
Prototype.Version; | |
$('abc'); | |
var marking_labels=[/Q1\s+Correctness/, /Q2\s+Correctness/, /Q3\s+Correctness/]; | |
var mark_to_tier=[$w("0 1 2 2 3 3 4"),$w("0 1 2 2 3 3 4"),$w("0 1 1 2 2 2 2 3 3 3 4")]; | |
var autotest_labels=[/Question\s+1:\s+(\d+)\/6/,/Question\s+2:\s+(\d+)\/6/,/Question\s+3:\s+(\d+)\/10/]; | |
var contains = function(regex) { return function(element) { return element.textContent.match(regex) } }; | |
var indicies = function(item) { return item[0][item[1]] }; | |
var buttons = function(labels) { | |
return labels.map(function(regex) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IN_FILE should be a file consists of one document per line | |
// OUT_FILE will be a file that consists of two parts: | |
// For each document the first part contains: | |
// DOC_ID DOCUMENT | |
// For each term the second part contains: | |
// TERM DOC_ID:POSITION ... | |
package main | |
import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"start": "History of Gibraltar", | |
"nodes": { | |
"History of Gibraltar": ["Iberian Peninsula", "Mediterranean Sea", "Visigothic Kingdom", "Charles VI"], | |
"Iberian Peninsula": ["Peninsula", "Europe", "Gibraltar"], | |
"Peninsula": ["Iberian Peninsula", "Europe"], | |
"Europe": ["Continent", "Peninsula"], | |
"Continent": ["Europe"], | |
"Gibraltar": ["Iberian Peninsula", "British Overseas Territories"], | |
"British Overseas Territories": ["Gibraltar"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TREC 2014 Context Generator | |
# | |
# This is the script used to generate contexts2014.csv the variables | |
# filename, username, and contexts2013_filename need to be filled in. | |
from bs4 import BeautifulSoup | |
from pandas import read_csv, DataFrame, merge | |
from random import sample | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>TREC 2014 Contextual Suggestion Track Contexts</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" /> | |
<style type="text/css"> | |
#map { height: 600px; width: 1000px; } | |
</style> | |
</head> | |
<body> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import sys, csv, re | |
import os.path | |
def usage(): | |
print("Usage: {0} resultsfile".format(sys.argv[0])) | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, nltk, math, sqlite3 | |
from pandas import read_csv | |
from six.moves.urllib.parse import quote | |
from collections import defaultdict | |
filename = 'examples2014.csv' | |
examples = read_csv(filename) | |
urls = examples['url'].tolist() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
url = “" | |
conn = sqlite.connect('fetch.db') | |
db = conn.curson() | |
db.execute("SELECT response FROM urls WHERE url = ?", (url,)) | |
response = db.fetchone()[0] | |
index = response.find('\n\n\n’) | |
body = response[index+3:] |
OlderNewer