Options
All
  • Public
  • Public/Protected
  • All
Menu

Module algorithm

Index

Functions

  • Deduplicate a pair of flashcards.

    Requires that card1 and card2 are English word-definition flashcards, where the front is a single English word and the back defines the word. Two cards in the English word-definition domain are "redundant" if and only if their fronts are identical.

    Parameters

    Returns false | Flashcard

    false if card1 and card2 are not "redundant" as defined above, otherwise a card that contains all the information from the redundant card1 and card2 that is relevant to learning.

  • getBucketRange(buckets: Set<Flashcard>[]): number[]
  • Find a minimal range of bucket numbers covering a list of learning buckets.

    Parameters

    • buckets: Set<Flashcard>[]

      a list of disjoint sets representing learning buckets, where buckets[i] is the set of cards in the ith bucket, for all nonnegative integers i that are valid indexes of the list.

    Returns number[]

    a pair of integers [low, high], 0 <= low <= high, such that every card in buckets has an integer bucket number in the range [low...high] inclusive, and high - low is as small as possible

  • Generate a sequence of flashcards for practice on a particular day.

    Parameters

    • day: number

      day of the learning process. Must be integer >= 1.

    • buckets: Set<Flashcard>[]

      a list of disjoint sets representing learning buckets, where buckets[i] is the set of cards in the ith bucket for all 0 <= i <= retiredBucket

    • retiredBucket: number

      number of retired bucket. Must be an integer >= 0.

    Returns Flashcard[]

    a sequence of flashcards such that a card appears in the sequence if and only if its bucket number is some i < retiredBucket such that day is divisible by 2^i

  • Reorganize learning buckets from a map representation to a list-of-sets representation.

    Parameters

    • bucketNumbers: Map<Flashcard, number>

      maps each flashcard to a (nonnegative integer) bucket number

    Returns Set<Flashcard>[]

    a list of disjoint sets whose union is the set of cards in bucketNumbers, and where list[i] is the set of cards that bucketNumbers maps to i, for all i in [0, list.length).

  • Update step for the Modified-Leitner algorithm.

    Parameters

    • card: Flashcard

      a flashcard the user just saw

    • answer: AnswerDifficulty

      the user's answer to the flashcard

    • bucketMap: Map<Flashcard, number>

      represents learning buckets before the flashcard was seen. Maps each flashcard in the map to a nonnegative integer bucket number in the range [0...retiredBucket] inclusive. Mutated by this method to put card in the appropriate bucket, as determined by the Modified-Leitner algorithm.

    • retiredBucket: number

      number of retired bucket. Must be an integer >= 0.

    Returns void

Generated using TypeDoc