opennlp-similarity/src/main/java/opennlp/tools/apps/review_builder/WebPageReviewExtractor.java [49:76]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		StringDistanceMeasurer meas = new StringDistanceMeasurer();

		List<Integer> idsToRemove = new ArrayList<>();
		List<String> hitsDedup = new ArrayList<>();
		try {
			for (int i = 0; i < hits.length; i++)
				for (int j = i + 1; j < hits.length; j++) {
					String title1 = hits[i];
					String title2 = hits[j];
					if (StringUtils.isEmpty(title1) || StringUtils.isEmpty(title2))
						continue;
					if (meas.measureStringDistance(title1, title2) > 0.7) {
						idsToRemove.add(j); // dupes found, later list member to be deleted
					}
				}
			for (int i = 0; i < hits.length; i++)
				if (!idsToRemove.contains(i))
					hitsDedup.add(hits[i]);
			if (hitsDedup.size() < hits.length) {
				System.out.println("Removed duplicates from relevant search results, including "
					+ hits[idsToRemove.get(0)]);
			}
		}
		catch (Exception e) {
			System.out.println("Problem removing duplicates from relevant images");
		}

		return hitsDedup.toArray(new String[0]);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



opennlp-similarity/src/main/java/opennlp/tools/parse_thicket/apps/SnippetToParagraph.java [195:223]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		StringDistanceMeasurer meas = new StringDistanceMeasurer();

		List<Integer> idsToRemove = new ArrayList<>();
		List<String> hitsDedup = new ArrayList<>();
		try {
			for (int i = 0; i < hits.length; i++)
				for (int j = i + 1; j < hits.length; j++) {
					String title1 = hits[i];
					String title2 = hits[j];
					if (StringUtils.isEmpty(title1) || StringUtils.isEmpty(title2))
						continue;
					if (meas.measureStringDistance(title1, title2) > 0.7) {
						idsToRemove.add(j); // dupes found, later list member to
						// be deleted
					}
				}
			for (int i = 0; i < hits.length; i++)
				if (!idsToRemove.contains(i))
					hitsDedup.add(hits[i]);
			if (hitsDedup.size() < hits.length) {
				System.out.println("Removed duplicates from relevant search results, including "
						+ hits[idsToRemove.get(0)]);
			}
		}
		catch (Exception e) {
			System.out.println("Problem removing duplicates from relevant images");
		}

		return hitsDedup.toArray(new String[0]);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



