Class CacheDatabase

java.lang.Object
edu.tufts.hrilab.slug.parsing.cache.CacheDatabase

public class CacheDatabase extends Object
  • Constructor Details

    • CacheDatabase

      public CacheDatabase(String name, String[] loadPaths, boolean persist)
  • Method Details

    • add

      public void add(Utterance entry)
      Adds an Utterance entry to the cache database.
      Parameters:
      entry - The Utterance object to add to the cache.
    • get

      public Utterance get(Utterance incoming)
      Retrieves an Utterance entry from the cache database based on the words in the incoming Utterance. If the entry exists in the cache, updates the incoming Utterance with cached values.
      Parameters:
      incoming - The Utterance object containing the words to retrieve from the cache.
      Returns:
      The Utterance object with updated values if found in the cache; otherwise, returns the incoming Utterance unchanged.