com.github.liblevenshtein.transducer.ITransducer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liblevenshtein-lite Show documentation
Show all versions of liblevenshtein-lite Show documentation
A library for spelling-correction based on Levenshtein Automata.
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);
}