예제 #1
0
    headers = analyzed_file.readline().split(',')[1:] # Headers
    data = analyzed_file.readline().split(',')[1:] # actual data
    features = dict(zip(headers,data))
    return features




if __name__ == '__main__':
    #test_sample = [{'raw':'The big dog ate the fox.'},{'raw':'The orange kitten exploded.'},{'raw':'Glass cut through his veins.'},{'raw':'He shoved a stick up his asshole'}]
    #features = get_structure_features(test_sample)
    #for k,v in features.iteritems():
    #    print 'feature: ' + str(k) + ' value: ' + str(v)

    #thread = start_stanford_server() # Start the server
    dvr.get_all_pickles()
    #thread.stop_server()

    #root = build_tree('u(ROOT\n  (S\n    (NP (DT The) (JJ quick) (JJ brown) (NN fox))\n    (VP (VBD jumped)\n      (PP (IN over)\n        (NP (DT the) (JJ lazy) (NN dog))))\n    (. .)))')
    # process dbank control

	#get_structure_features('stanford/processed/dbank/control', 'dbank/control_SCA')
    # process dbank dementia
    #get_structure_features('stanford/processed/dbank/dementia', 'dbank/dementia_SCA')
    # print "Starting server"
    # thread = start_stanford_server() # Start the server
    # try:
    #     tree = get_parse_tree('The quick brown fox jumped over the lazy dog.')
    #     root = build_tree(tree)
    #     print get_VP_2_AUX(tree_node)
    #     build_tree('u(ROOT\n  (S\n    (NP (DT The) (JJ quick) (JJ brown) (NN fox))\n    (VP (VBD jumped)\n      (PP (IN over)\n        (NP (DT the) (JJ lazy) (NN dog))))\n    (. .)))')