private double algorithm1 ( String [ ] tTokens , String [ ] uTokens , double [ ] tIdfArray , double [ ] uIdfArray ) { ArrayList candidateList = obtainCandidateList ( tTokens , uTokens , tIdfArray , uIdfArray ) ; sortCandidateList ( candidateList ) ; double scoreValue = 0.0 ; HashMap tMap = new HashMap ( ) , uMap = new HashMap ( ) ; Iterator it = candidateList . iterator ( ) ; while ( it . hasNext ( ) ) { Candidates actualCandidates = ( Candidates ) it . next ( ) ; Integer tPos = new Integer ( actualCandidates . getTPos ( ) ) ; Integer uPos = new Integer ( actualCandidates . getUPos ( ) ) ; if ( ( ! tMap . containsKey ( tPos ) ) && ( ! uMap . containsKey ( uPos ) ) ) { double actualScore = actualCandidates . getScore ( ) ; scoreValue += actualScore ; tMap . put ( tPos , null ) ; uMap . put ( uPos , null ) ; } } return scoreValue ; }
algorithm1 select the considered most appropiate token pairs and compute the sum of the selected pairs .