import csv

# need further investigation (next column) of:
# Assist Other Agency
# Service to Other Agency 
# Public Contact
# Public Service

if __name__ == "__main__":
	cats = {}
	with open('data/raw_blotter.csv', 'r') as inFile:
		reader = csv.reader(inFile)
		for row in reader:
			cat = row[6]
			if cat in cats:
				cats[cat] += 1
			else:
				cats[cat] = 1

	for cat in cats:
		print cat, cats[cat]


def getCategory(crime):
	return categoryMapping[crime]

crimeCategories = [
	"Traffic",
	"Theft",
	"Drugs/Alcohol",
	"Fire",
	"Medical",
	"Violence",
	"Harassment/Sexual Assault",
	"Noise/Disturbances",
	"Suspicious Circumstances",
	"Trespass",
	"Fraud",
	"Property",
	"Safety Hazard",
	"Security",
	"Unsafe Person/Animals",
	"General/Other",
]

categoryMapping = {
	"False alarm activation": "Fraud",
	"Unsecured Building/Office": "Security",
	"Disturbance": "Noise/Disturbances",
	"Cannabis": "Drugs/Alcohol",
	"Pub.relation activities": "General/Other",
	"Property - Lost/Found": "Property",
	"Property Damage - Criminal": "Property",
	"Criminal Sexual Abuse": "Harassment/Sexual Assault",
	"Lost & found prop": "Property",
	"Battery - Aggravated": "Violence",
	"Fraudulent activities": "Fraud",
	"Hazardous Condition": "Safety Hazard",
	"Fire Hazard": "Fire",
	"Domestic Violence": "Violence",
	"Runaways": "Unsafe Person/Animals",
	"Sex offenses": "Harassment/Sexual Assault",
	"Robbery": "Theft",
	"Hazardous condition": "Safety Hazard",
	"Death Investigation": "Unsafe Person/Animals",
	"Safety Hazard": "Safety Hazard",
	"Hit and Run": "Traffic",
	"Delinquent minors": "Unsafe Person/Animals",
	"Burglary - Auto": "Theft",
	"Weapons offenses": "Unsafe Person/Animals",
	"Liquor Law Violation": "Drugs/Alcohol",
	"Mental Case": "Unsafe Person/Animals",
	"Accident, all other": "Safety Hazard",
	"Drug Offense - Arrest\Citation": "Drugs/Alcohol",
	"Sex Offenses - Forcible": "Harassment/Sexual Assault",
	"Administrative Information": "General/Other",
	"Out of State Warrant": "Unsafe Person/Animals",
	"Sexual assault": "Harassment/Sexual Assault",
	"Accident, fire": "Fire",
	"Traffic offenses": "Traffic",
	"Fire - Arson": "Fire",
	"Traffic Crash - Vehicle Only": "Traffic",
	"Valid alarm activation": "Fire",
	"Lost/Found Prop": "Property",
	"Dangerous drugs": "Drugs/Alcohol",
	"Trespass": "Trespass",
	"Misc criminal offense": "General/Other",
	"Standby": "General/Other",
	"Assault": "Violence",
	"Assist Other Agency": "General/Other",
	"Medical Services - Alcohol": "Drugs/Alcohol",
	"Theft Over 500": "Theft",
	"Medical Servicies - Alcohol": "Drugs/Alcohol",
	"Liquor law violations": "Drugs/Alcohol",
	"Trespass - Residential": "Trespass",
	"Stolen property": "Theft",
	"Accident, nontraffic": "Safety Hazard",
	"Fire - No Fire": "Fire",
	" Hazard Mat": "Safety Hazard",
	"Battery": "Violence",
	"Valid Alarm Activation": "Fire",
	"Burglary - Non Residential": "Theft",
	"Public peace": "Noise/Disturbances",
	"Motor vehicle theft": "Theft",
	"Drunkeness": "Drugs/Alcohol",
	"Robbery - Attempted": "Theft",
	"Sex Offenses - Non-Forcible": "Harassment/Sexual Assault",
	"Fire - Smoking Materials": "Fire",
	"Obstructing Police": "Unsafe Person/Animals",
	"Traffic Crash - Ped vs Vehicle": "Traffic",
	"Service to Other Agency": "General/Other",
	"Public Contact": "General/Other",
	"Suspicious Person(s)": "Suspicious Circumstances",
	"Suspicious Circumstances": "Suspicious Circumstances",
	"Cyberstalking": "Harassment/Sexual Assault",
	"In - State Warrant": "Unsafe Person/Animals",
	"Missing Person": "Unsafe Person/Animals",
	"Noise Complaint": "Noise/Disturbances",
	" Invest Odor": "Safety Hazard",
	"Accident, boating": "Traffic",
	"Fire - Electrical": "Fire",
	"Traffic Arrest": "Traffic",
	" Public Health": "Safety Hazard",
	"Theft Under 500": "Theft",
	"Immigration": "Unsafe Person/Animals",
	"Fire Call": "Fire",
	"Traffic Offenses": "Traffic",
	"Well Being Check": "Unsafe Person/Animals",
	"Fire - Heating Equipment": "Fire",
	"Dating Violence": "Violence",
	"Theft - Bicycle Parts": "Theft",
	"Mot Vehicle Offenses/Non Crim": "Traffic",
	"Fraud": "Fraud",
	"Animals": "Unsafe Person/Animals",
	"Theft": "Theft",
	"Obscenity": "Noise/Disturbances",
	"Damage property": "Property",
	"Drug Offense - Referral": "Drugs/Alcohol",
	"Public Service": "General/Other",
	"Accident, other water": "Safety Hazard",
	"Burglary - Residential": "Theft",
	"Fire - Open Flames": "Fire",
	"Traffic Crash - Bike vs Vehicle": "Traffic",
	"Tow/Commercial Impound": "Traffic",
	"Theft - Bicycle": "Theft",
	"Identity Theft": "Fraud",
	"Property Lost": "Property",
	"Forgery/counterfeiting": "Fraud",
	"Property found": "Property",
	"Domestic Situation": "Violence",
	"Attempted Robbery": "Theft",
	"Security Building": "Security",
	"Property - Recovered": "Property",
	"Harassment - Electronic": "Harassment/Sexual Assault",
	"Drug overdose": "Drugs/Alcohol",
	"Accident, explosion": "Safety Hazard",
	"Health - safety": "Safety Hazard",
	"Suspicious situations": "Suspicious Circumstances",
	"Medical Services": "Medical",
	"Fire - Other": "Fire",
	"Disorderly Conduct": "Noise/Disturbances",
	"Elevator Entrapment": "Safety Hazard",
	"Obstructing police": "Unsafe Person/Animals",
	"Drug Investigation": "Drugs/Alcohol",
	"Traffic Crash - Ped vs Bike": "Traffic",
	"Shots Fired": "Violence",
	"General non-criminal": "General/Other",
	"Intimidation": "Harassment/Sexual Assault",
	"Forgery\Counterfeiting": "Fraud",
	"Accident, traffic": "Traffic",
	"Burglary": "Theft",
	"Missing person": "Unsafe Person/Animals",
	"Admin Info": "General/Other",
	"Fire - Machinery/Industrial": "Fire",
	"Arson": "Fire",
	"Civ.infrac.-poss. alcoholic liq": "Drugs/Alcohol",
	"General assistance": "General/Other",
	"Stalking": "Harassment/Sexual Assault",
	"Attempted Suicide": "Safety Hazard",
	"Larceny - theft": "Theft",
	"Suspicious Persons": "Suspicious Circumstances",
	"Fire - Cooking": "Fire",
	"Parking viol.": "Traffic",
	"Accident, personal injury": "Safety Hazard",
	"Fire - Hazardous Products": "Fire",
	"Property Damage": "Property",
	"Personal Injury": "Safety Hazard",
	"Harassment": "Harassment/Sexual Assault",
	"Accident, bicycle": "Traffic",
}