code: private double computeSegmentationScore(Segmentation segmentation) {
  		double sum = 0;
  		int index = 0;
  		for(Segment s:segmentation.getSegments()) {
  			SegmentScoreEntry scoreEntry = index == (segmentation.size() - 1) ? 
  					getBestInflectedScoreEntry(s, this.inflectionRules):
  						getBestInflectedScoreEntry(s, this.transformationRules);
  			sum+=scoreEntry.getScore();
  			s.setLemma(scoreEntry.getDicoEntry() == null ? 
  					s.getSubstring() : 
  						scoreEntry.getDicoEntry().getText());
  			index++;
  		}
  		return sum / segmentation.size();
  	}
docs: /*
  Compute the score of a given segmentation