public TreeSet<FrequentSequenceItem> getLocallyFrequentItems(Set<FrequentSequenceItem> globallyFrequentItems,
			int minSupport) {
		Map<SequenceItem, Integer> frequentItemBag = new HashMap<SequenceItem, Integer>();
		for (ProjectedSequenceInfo currentProjSeq : projectedInfo) {
			for (FrequentSequenceItem globFreqItem : globallyFrequentItems) {
				SequenceItem globalItem = globFreqItem.getItem();
				int index = globalItem.getIndex();
				if (index < currentProjSeq.getProjectedIndex()) {
					continue;//the globally frequent item is in a position in the prefix, no need to check
				}
				Sequence fullSequence =
					database.getSequences().get(currentProjSeq.getSequenceIndex());
				String symbol = fullSequence.getSequenceAsString().substring(index, index + 1);

				if (!symbol.equals(globalItem.getSymbol())) {
					continue;//symbols are different, check next item
				}

				Integer count = frequentItemBag.get(globalItem);
				if (count == null) {
					frequentItemBag.put(globalItem, Integer.valueOf(fullSequence.getCount()));
				}
				else {
					frequentItemBag.put(globalItem, count + fullSequence.getCount());
				}
			}
		}

		TreeSet<FrequentSequenceItem> frequentItemSet = new TreeSet<FrequentSequenceItem>();
		for (Entry<SequenceItem, Integer> itemAndCount : frequentItemBag.entrySet()) {
			int count = itemAndCount.getValue();
			if (count >= minSupport) {
				frequentItemSet.add(new FrequentSequenceItem(count, itemAndCount.getKey()));
			}
		}
		return frequentItemSet;
	}
Returns a set of {@link FrequentSequenceItem}s composed of all {@link FrequentSequenceItem}s in {@code globallyFrequentItems} 
which occur after the projection index and in at least {@code minSupport} sequences in the projected database.
@param globallyFrequentItems
@param minSupport 
@return
Ghidra/Features/BytePatterns/src/main/java/ghidra/closedpatternmining/ProjectedDatabase.java