$fileError = FileOpen( $TEMP & $filenameError, 1 + 8 ) For $i = 1 To $errorCompare[0] FileWriteLine( $fileError, $arrayInput[$errorCompare[$i]] ) _ArrayDelete( $arrayInput, $errorCompare[$i] ) Next FileClose( $fileError ) $arrayInput[0] = $arrayInput[0] - $errorCompare[0] ;; Write words in array to first line of output file using comma separation $fileOutput = FileOpen( $TEMP & $filenameOutput, 1 + 8 ) For $i = 1 To $arrayInput[0] FileWrite( $fileOutput, $arrayInput[$i] ) If $i < $arrayInput[0] Then FileWrite( $fileOutput, "," ) Else FileWriteLine( $fileOutput, "" ) Next ;; Compare words using WordNet::Similarity and write results to output file using comma separation For $i = 1 To $arrayInput[0] $compareFirst = $arrayInput[$i] & $SUFFIX_NOUN For $j = 1 To $arrayInput[0] $compareSecond = $arrayInput[$j] & $SUFFIX_NOUN $PerlOutput = RunWait( @ComSpec & " /k cd " & $COMMAND_Perl_SIMILARITY_SCRIPT_DIRECTORY & " && " & $COMMAND_Perl_SIMILARITY & $PerlScript & " " & $compareFirst & " " & $compareSecond & " > " & $TEMP & $TEMP_FILENAME & " && exit" ) $output = FileReadLine( $TEMP & $TEMP_FILENAME ) FileWrite( $fileOutput, $output ) If $j < $arrayInput[0] Then FileWrite( $fileOutput, "," ) Else FileWriteLine( $fileOutput, "" ) EndIf Next Next FileClose( $fileOutput ) Else $error = True SetError( 3 ) EndIf Else = True SetError( 2 ) EndIf
$fileError = FileOpen( $TEMP & $filenameError, 1 + 8 ) For $i = 1 To $errorCompare[0] FileWriteLine( $fileError, $arrayInput[$errorCompare[$i]] ) _ArrayDelete( $arrayInput, $errorCompare[$i] ) Next FileClose( $fileError ) $arrayInput[0] = $arrayInput[0] - $errorCompare[0] ;; Write words in array to first line of output file using comma separation $fileOutput = FileOpen( $TEMP & $filenameOutput, 1 + 8 ) For $i = 1 To $arrayInput[0] FileWrite( $fileOutput, $arrayInput[$i] ) If $i < $arrayInput[0] Then FileWrite( $fileOutput, "," ) Else FileWriteLine( $fileOutput, "" ) Next ;; Compare words using WordNet::Similarity and write results to output file using comma separation For $i = 1 To $arrayInput[0] $compareFirst = $arrayInput[$i] & $SUFFIX_NOUN For $j = 1 To $arrayInput[0] $compareSecond = $arrayInput[$j] & $SUFFIX_NOUN $PerlOutput = RunWait( @ComSpec & " /k cd " & $COMMAND_Perl_SIMILARITY_SCRIPT_DIRECTORY & " && " & $COMMAND_Perl_SIMILARITY & $PerlScript & " " & $compareFirst & " " & $compareSecond & " > " & $TEMP & $TEMP_FILENAME & " && exit" ) $output = FileReadLine( $TEMP & $TEMP_FILENAME ) FileWrite( $fileOutput, $output ) If $j < $arrayInput[0] Then FileWrite( $fileOutput, "," ) Else FileWriteLine( $fileOutput, "" ) EndIf Next Next FileClose( $fileOutput ) Else $error = True SetError( 3 ) EndIf Else = True SetError( 2 ) EndIf
MIS696A-FinalProject-2009-Report.docx