All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.liblevenshtein.transducer.ITransducer Maven / Gradle / Ivy

There is a newer version: 3.0.1
Show newest version
package com.github.liblevenshtein.transducer;

import java.io.Serializable;

/**
 * Returns a collection of spelling candidates for the given query term.
 * @author Dylon Edwards
 * @param  Kind of spelling candidate returned (e.g.
 *   {@link Candidate} or {@link java.lang.String}).
 * @since 2.1.0
 */
public interface ITransducer extends Serializable {

  /**
   * Finds all terms in the dictionary that are fewer than n units of spelling
   * errors away from the query term.
   * @param term Query term whose spelling candidates should bee determined
   * @return A data structure consisting of all the spelling candidates for the
   *   query term.
   */
  Iterable transduce(String term);

  /**
   * Finds all terms in the dictionary that are fewer than n units of spelling
   * errors away from the query term.
   * @param term Query term whose spelling candidates should bee determined
   * @param maxDistance Maximum number of spelling errors the spelling
   *   candidates may have from the query term.
   * @return A data structure consisting of all the spelling candidates for the
   *   query term.
   */
  Iterable transduce(String term, int maxDistance);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy