Пример #1
0
def process_sentences_ST1(usr,layers,pur_p):
     print 'Collect ractionlines for(2):',pur_p,'-----'
     ractionlines=mdOntology.mdBaseOntology(usr,pur_p)
     print 'Found:',len(ractionlines.nodesER)
     process_termost(layers,usr,pur_p,ractionlines)
Пример #2
0
            try:
                sock = socket.socket()
                sock.connect((host, port))
            except Exception, e:
                print 'Not connected....', e
                time.sleep(5)
                continue
            sock.settimeout(None)
            sock.send(ID)
            pur_p2 = sock.recv(1024)
            print 'receive-purpose:', pur_p2
            return pur_p2

    #
    pur_p = start_socket()
    ractionlinesG = mdOntology.mdBaseOntology(usr, pur_p)
    mdNeural.self_usr = usr
    mdNeural.type_coll = '1'
    SemaIniParser.start_module(usr, pur_p)
    #==========================================================
    #==========================================================
    #==========================================================
    #==========================================================
    conts = 0
    while True:
        # receive sentences an process them
        print 'Wait for sentences....'
        try:
            sentence = sock.recv(1024)
            print 'Start process new sentence..', sentence
            #===========