code: private double getScore(int pos, Lexicon lexicon, double numdocs) {
  		double score = 0;
  		int indexTerm = this.indices[pos];
  		double occurences = (double) this.freqs[pos];
  
  		int fieldNum = this.indexToField[pos];
  		double frequency = occurences / tokensPerField[fieldNum];
  
  		// is there a custom weight for this field?
  		String fieldName = lexicon.getFields()[fieldNum];
  		WeightingMethod method = lexicon.getMethod(fieldName);
  
  		if (method.equals(Parameters.WeightingMethod.BOOLEAN)) {
  			score = 1;
  		} else if (method.equals(Parameters.WeightingMethod.OCCURRENCES)) {
  			score = occurences;
  		} else if (method.equals(Parameters.WeightingMethod.FREQUENCY)) {
  			score = frequency;
  		} else if (method.equals(Parameters.WeightingMethod.TFIDF)) {
  			int df = lexicon.getDocFreq(indexTerm);
  			double idf = numdocs / (double) df;
  			score = frequency * Math.log(idf);
  			if (idf == 1)
  				score = frequency;
  		}
  		return score;
  	}
docs: Returns the score of an attribute given the weighting scheme specified in
  the lexicon or for a specific field