private Set<String> reduceKeywordSet(String urlChunk, Set<String> fullKeywordSet) {
        List<String> keywordsOrdered = new ArrayList<>(fullKeywordSet);
        Collections.sort(keywordsOrdered, new KeywordComparator());
        for (String keyword : keywordsOrdered) { // give preference to longer keywords.
            if (!fullKeywordSet.contains(keyword)) {
                continue;
            }
            String urlChunkBitten = urlChunk.replaceAll(keyword, "");
            for (String keyword2 : keywordsOrdered) {
                if (keyword.equals(keyword2)) {
                    continue;
                }
                if (!urlChunkBitten.contains(keyword2)) {
                    fullKeywordSet.remove(keyword2);
                }
            }
        }
        return fullKeywordSet;
    }