webapp/scrape.py
def parse(url):
    """ Parses the data fetched from fetch_url
        If its not empty, frequency, POS, sentiment of the text are
        returned back to front-end.
    """
    soup = fetch_url(url)
    result = {}
    if soup:
        text = text_from_html(soup)
        text = re.sub(' +', ' ', text)
        result_list = pos_text(text)
	#print "result_list", result_list
	word_tuple = []
	for x in result_list:
	    res = hash_word(x)
	    word_tuple.append(res)
	print "word_tuple", word_tuple
	url_hashed = hash_word(quote(url))
	sent = get_intent(url)
	update_table((url_hashed, sent), "string")
	for y in word_tuple:
	    update_table(y, "tuple")
        for (x,y) in result_list:
            result[x]=y
        return result
    else:
        print "Alert the url could not be found"
        return ""
 Parses the data fetched from fetch_url
        If its not empty, frequency, POS, sentiment of the text are
        returned back to front-end.
    
Parses the data fetched from fetch_url
If its not empty, frequency, POS, sentiment of the text are
returned back to front-end.
Parses the data fetched from fetch_url If its not empty frequency POS sentiment of the text are returned back to front - end .
def parse(url):
    soup = fetch_url(url)
    result = {}
    if soup:
        text = text_from_html(soup)
        text = re.sub(' +', ' ', text)
        result_list = pos_text(text)
	word_tuple = []
	for x in result_list:
	    res = hash_word(x)
	    word_tuple.append(res)
	print "word_tuple", word_tuple
	url_hashed = hash_word(quote(url))
	sent = get_intent(url)
	update_table((url_hashed, sent), "string")
	for y in word_tuple:
	    update_table(y, "tuple")
        for (x,y) in result_list:
            result[x]=y
        return result
    else:
        print "Alert the url could not be found"
        return ""
def parse ( url ) : soup = fetch_url ( url ) result = { } if soup : text = text_from_html ( soup ) text = re . sub ( ' +' , ' ' , text ) result_list = pos_text ( text ) word_tuple = [ ] for x in result_list : res = hash_word ( x ) word_tuple . append ( res ) print "word_tuple" , word_tuple url_hashed = hash_word ( quote ( url ) ) sent = get_intent ( url ) update_table ( ( url_hashed , sent ) , "string" ) for y in word_tuple : update_table ( y , "tuple" ) for ( x , y ) in result_list : result [ x ] = y return result else : print "Alert the url could not be found" return ""
Parses the data fetched from fetch_url
If its not empty, frequency, POS, sentiment of the text are
returned back to front-end.
Parses the data fetched from fetch_url If its not empty frequency POS sentiment of the text are returned back to front - end .
""" Parses the data fetched from fetch_url
        If its not empty, frequency, POS, sentiment of the text are
        returned back to front-end.
    """ #print "result_list", result_list
url