Skip to content

Instantly share code, notes, and snippets.

View marsimaria's full-sized avatar

Maria Fang marsimaria

View GitHub Profile
@marsimaria
marsimaria / OnLady.py
Created May 15, 2015 16:58
On "How to be a Lady" By Britney Spears
from textblob import TextBlob
import random
import re
# Lady02 Text1
lady = list()
# Lady01 Text1
search = r'\b(?:[Ww]ell-bred|[Ii]ll-bred|lady-like|unlady-like|lady)\b [A-Za-z ]+'
# search = r'\b(?:[Ii]f you|[Ii]f they|[Ii]f it)\b [A-Za-z ]+'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marsimaria
marsimaria / tombowners.json
Last active August 29, 2015 14:19
Sogdian Tomb Owners
[
{
"tombowner": "Kang Ye",
"period": "Northern Zhou",
"death_site": "",
"burial_site": "Xi'an",
"lived_site": "Ganzhou",
"origin": "Samarkand"
},
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marsimaria
marsimaria / sogdians.geojson
Last active August 29, 2015 14:19
Locations for Sogdian Map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marsimaria
marsimaria / MDV10.R
Last active August 29, 2015 14:18
Mapping closest amphitheaters base on travel expense
#load libraries
library(igraph)
library(curl)
library(rgdal)
library(rgeos)
library(maptools)
library(ggplot2)
#load data sets
orbis_edges <-read.csv(curl("https://stacks.stanford.edu/file/druid:mn425tz9757/orbis_edges_0514.csv"),head=TRUE)
@marsimaria
marsimaria / sunflowerM1.py
Created April 7, 2015 00:58
Sunflower Module 1 - A module with multiple functions
import goslate
def getText(text):
gs = goslate.Goslate()
with open('sunflower.txt', 'r') as f:
text = f.read()
l = []
l_array = []
@marsimaria
marsimaria / sunflowerM2.py
Last active August 29, 2015 14:18
Sunflower module 2 - Execute my midterm project in two lines of code
import goslate
def generate(text):
gs = goslate.Goslate()
with open(text, 'r') as f:
text = f.read()
l = []
for i in range(100):