private static int scoreMatchingTokens(List<String> array1, List<String> array2)
	{
		HashMap<String, Integer> array1Counts = new HashMap<String, Integer>();
		HashMap<String, Integer> array2Counts = new HashMap<String, Integer>();

		for (String t : array1)
		{
			if (array1Counts.containsKey(t))
			{
				array1Counts.put(t, new Integer(array1Counts.get(t).intValue() + 1));
			}
			else
			{
				array1Counts.put(t, new Integer(1));
			}
		}

		for (String t : array2)
		{
			if (array1Counts.containsKey(t))
			{
				if (array2Counts.containsKey(t))
				{
					array2Counts.put(t, new Integer(array2Counts.get(t).intValue() + 1));
				}
				else
				{
					array2Counts.put(t, new Integer(1));
				}
			}
		}

		int result = 0;
		String token;
		if (array2Counts.keySet().size() > 0)
		{
			result = array2Counts.keySet().size() == 1 ? 1 : (int) Math.pow(3.0, (double) array2Counts.keySet().size());
			Iterator<String> array2CountsIterator = array2Counts.keySet().iterator();
			while (array2CountsIterator.hasNext())
			{
				token = array2CountsIterator.next();
				int array1Count = array1Counts.get(token).intValue();
				int array2Count = array2Counts.get(token).intValue();
				if (array1Count < array2Count)
				{
					result = result + ((token.length() - 1) * array1Count);
				}
				else
				{
					result = result + ((token.length() - 1) * array2Count);
				}
			}
		}

		return result;
	}