private static void calculateProperties(
			List<HashMap<String, CandidateToken>> candidateString)
	{
		for (int i = 1; i < candidateString.size(); i++)
		{

			HashMap<String, CandidateToken> candidateTokens0 = candidateString
					.get(i);
			String key;
			CandidateToken candidateToken;
			double total;
			if (i == 0)
			{
				total = 0.0;

				for (Entry<String, CandidateToken> entry : candidateTokens0
						.entrySet())
				{
					key = entry.getKey();
					candidateToken = entry.getValue();
					double t = probability(key, candidateToken.getCounter(),
							START_SYMBOL, 0);

					total += t;
				}
				for (Entry<String, CandidateToken> entry : candidateTokens0
						.entrySet())
				{
					candidateToken = entry.getValue();
					candidateToken.setPrior(START_SYMBOL);
					candidateToken.setProbability(total
							/ candidateTokens0.size());
				}
			}
			else
			{
				HashMap<String, Double> totals = new HashMap<String, Double>();
				HashMap<String, Integer> counts = new HashMap<String, Integer>();
				for (Entry<String, CandidateToken> entry0 : candidateTokens0
						.entrySet())
				{
					String key0 = entry0.getKey();
					CandidateToken candidateToken0 = entry0.getValue();
					HashMap<String, CandidateToken> candidateTokens1 = candidateString
							.get(i - 1);

					for (Entry<String, CandidateToken> entry1 : candidateTokens1
							.entrySet())
					{
						double t;
						String key1 = entry1.getKey();
						CandidateToken candidateToken1 = entry1.getValue();

						t = probability(key0, candidateToken0.getCounter(),
								candidateToken1.getPrior(), candidateToken1
										.getProbability());

						if (!totals.containsKey(key1))
						{
							totals.put(key1, t);
							counts.put(key1, 1);
						}
						else
						{
							totals.put(key1, t + totals.get(key1));
							counts.put(key1, counts.get(key1) + 1);
						}
					}

				}
				for (Entry<String, Double> entry : totals.entrySet())
				{
					key = entry.getKey();
					total = totals.get(key) / counts.get(key);
					totals.put(key, total);
				}

				List<Entry<String, Double>> tRanks = new ArrayList<Entry<String, Double>>(
						totals.entrySet());
				Collections.sort(tRanks,
						new Comparator<Entry<String, Double>>()
						{
							@Override
							public int compare(Entry<String, Double> e1,
									Entry<String, Double> e2)
							{
								return (int) (e1.getValue() - e2.getValue()
										/ Math.abs((e1.getValue() - e2
												.getValue())));
							}
						});

				for (Entry<String, CandidateToken> entry : candidateTokens0
						.entrySet())
				{
					candidateToken = entry.getValue();
					int rank = (int) (Math.random() * CANDIDATE_RANK);
					candidateToken.setProbability(tRanks.get(rank).getValue());
					candidateToken.setPrior(tRanks.get(rank).getKey());
				}
			}
		}
	}