#class TIris is the compiled SECoS network
import TIris, sys, string

#loads the user-specified text file containing the data to recall the SECoS with
TestFileName = sys.argv [ 1 ]
TestFile = open ( TestFileName )
Test = TestFile.readlines ()
TestFile.close ()

TheNetwork = TIris.TIris ()

#recall the SECoS one line of data at a time
for CurrLine in Test:
    #format the data into a vector to recall the SECoS
    CurrLine = string.strip ( CurrLine )
    Tokens = string.split ( CurrLine, "," )
    InputVector = []
    for CurrTok in Tokens:
        InVal = float ( CurrTok )
        InputVector.append ( InVal )

    #perform the recall        
    Output = TheNetwork.Recall ( InputVector )

    #create the output string for that recall vector
    OutputString = ''
    for CurrOut in Output:
        OutputString = OutputString + str ( CurrOut ) + ' '
    OutputString = OutputString + '\n'

    print string.strip ( OutputString )
    
