def classifyZipcode(location_text):
    classifier = recognition_heuristic.naivebayes(recognition_heuristic.getwords)

    classifier.setdb('test_100.db')

    classified_zipcode = classifier.classify(location_text)

    zipcode = str(classified_zipcode[0])
    confidence = str(classfied_zipcode[1])

    #query MYSQL database and append to python list
    cur = db.cursor()
    cur.execute("SELECT latitude,longitude FROM sqlbook.zipcounty WHERE zipcode = %s", zipcode)
    rows = cur.fetchall()
    latitude = rows[0][0]
    longitude = rows[0][1]

    likely_zipcode = {"location_text": location_text, "zipcode": zipcode, "latitude": latitude, "longitude": longitude}
    weather = get__weather_data.getWeather(likely_zipcode['zipcode'])

    likely_zipcode.update(weather)
    return likely_zipcode
# Licence:     <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/env python

import recognition_heuristic
import MySQLdb
import string

def main():
    pass

#Step 1: classify objects in some text with a likely location code

     #use on unstructured text

classifier = recognition_heuristic.naivebayes(recognition_heuristic.getwords)

    #use this function if given a dictionary or key/value structured storage of text

##classifier = recognition_heuristic.naivebayes(wordmatrixfeatures)

#Step 2: Set the database to store the training. Set the region to train

classifier.setdb('likely_zipcode.db')
state = 'CA'
#Step 3: Train the text with a location code

   #initial test training already carried out
##recognition_heuristic.frequency_train(classifier)
##recognition_heuristic.impact_train(classifier)