Package flashcards

Class Deduplicate

java.lang.Object
flashcards.Deduplicate

public class Deduplicate
extends Object
Consolidate a set of flashcards by finding redundant cards.
  • Method Details

    • deduplicate

      public static Map<Flashcard,​Set<Flashcard>> deduplicate​(Set<Flashcard> originalCards)
      Deduplicate a set of flashcards. This method finds groups of cards with similar fronts, and for each such group, recommends one canonical flashcard that includes the information from all cards in the group. This allows the user to learn more efficiently using the set of canonical cards instead. This set may have fewer cards than the original set, but it contains the same information relevant to learning. Identical fronts are always similar, but fronts can be similar for other reasons as well.
      Parameters:
      originalCards - a set of flashcards
      Returns:
      a map in which each key is a canonical card mapping to a nonempty set of similar-front cards. The sets of similar-front cards are disjoint, and their union is originalCards.