Package me.xdrop.fuzzywuzzy
Class Extractor
- java.lang.Object
-
- me.xdrop.fuzzywuzzy.Extractor
-
public class Extractor extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtractedResultextractOne(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func)Find the single best match above a score in a list of choices.<T> BoundExtractedResult<T>extractOne(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func)Find the single best match above a score in a list of choices.java.util.List<ExtractedResult>extractTop(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func)Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choicesjava.util.List<ExtractedResult>extractTop(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func, int limit)Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choices<T> java.util.List<BoundExtractedResult<T>>extractTop(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func)Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choices<T> java.util.List<BoundExtractedResult<T>>extractTop(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func, int limit)Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choicesjava.util.List<ExtractedResult>extractWithoutOrder(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func)Returns the list of choices with their associated scores of similarity in a list ofExtractedResult<T> java.util.List<BoundExtractedResult<T>>extractWithoutOrder(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func)Returns the list of choices with their associated scores of similarity in a list ofExtractedResultintgetCutoff()voidsetCutoff(int cutoff)Extractorwith(int cutoff)
-
-
-
Method Detail
-
with
public Extractor with(int cutoff)
-
extractWithoutOrder
public java.util.List<ExtractedResult> extractWithoutOrder(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func)
Returns the list of choices with their associated scores of similarity in a list ofExtractedResult- Parameters:
query- The query stringchoices- The list of choicesfunc- The function to apply- Returns:
- The list of results
-
extractWithoutOrder
public <T> java.util.List<BoundExtractedResult<T>> extractWithoutOrder(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func)
Returns the list of choices with their associated scores of similarity in a list ofExtractedResult- Parameters:
query- The query stringchoices- The list of choicestoStringFunction- The ToStringFunction to be applied to all choices.func- The function to apply- Returns:
- The list of results
-
extractOne
public ExtractedResult extractOne(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func)
Find the single best match above a score in a list of choices.- Parameters:
query- A string to match againstchoices- A list of choicesfunc- Scoring function- Returns:
- An object containing the best match and it's score
-
extractOne
public <T> BoundExtractedResult<T> extractOne(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func)
Find the single best match above a score in a list of choices.- Parameters:
query- A string to match againstchoices- A list of choicestoStringFunction- The ToStringFunction to be applied to all choices.func- Scoring function- Returns:
- An object containing the best match and it's score
-
extractTop
public java.util.List<ExtractedResult> extractTop(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func)
Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choices- Parameters:
query- The query stringchoices- A list of choicesfunc- The scoring function- Returns:
- A list of the results
-
extractTop
public <T> java.util.List<BoundExtractedResult<T>> extractTop(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func)
Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choices- Parameters:
query- The query stringchoices- A list of choicestoStringFunction- The ToStringFunction to be applied to all choices.func- The scoring function- Returns:
- A list of the results
-
extractTop
public java.util.List<ExtractedResult> extractTop(java.lang.String query, java.util.Collection<java.lang.String> choices, Applicable func, int limit)
Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choices- Parameters:
query- The query stringchoices- A list of choiceslimit- Limits the number of results and speeds up the search (k-top heap sort) is used- Returns:
- A list of the results
-
extractTop
public <T> java.util.List<BoundExtractedResult<T>> extractTop(java.lang.String query, java.util.Collection<T> choices, ToStringFunction<T> toStringFunction, Applicable func, int limit)
Creates a sorted list ofExtractedResultwhich contain the top @param limit most similar choices- Parameters:
query- The query stringchoices- A list of choicestoStringFunction- The ToStringFunction to be applied to all choices.limit- Limits the number of results and speeds up the search (k-top heap sort) is used- Returns:
- A list of the results
-
getCutoff
public int getCutoff()
-
setCutoff
public void setCutoff(int cutoff)
-
-