MCPcopy Create free account
hub / github.com/xdrop/fuzzywuzzy / BasicAlgorithm

Class BasicAlgorithm

src/me/xdrop/fuzzywuzzy/algorithms/BasicAlgorithm.java:6–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import me.xdrop.fuzzywuzzy.ToStringFunction;
5
6public abstract class BasicAlgorithm implements Applicable {
7
8 private ToStringFunction<String> stringFunction;
9
10 public BasicAlgorithm() {
11 this.stringFunction = new DefaultStringFunction();
12 }
13
14 public BasicAlgorithm(ToStringFunction<String> stringFunction) {
15 this.stringFunction = stringFunction;
16 }
17
18 public abstract int apply(String s1, String s2, ToStringFunction<String> stringProcessor);
19
20 public int apply(String s1, String s2){
21
22 return apply(s1, s2, this.stringFunction);
23
24 }
25
26 public BasicAlgorithm with(ToStringFunction<String> stringFunction){
27 setStringFunction(stringFunction);
28 return this;
29 }
30
31 public BasicAlgorithm noProcessor(){
32 this.stringFunction = ToStringFunction.NO_PROCESS;
33 return this;
34 }
35
36 void setStringFunction(ToStringFunction<String> stringFunction){
37 this.stringFunction = stringFunction;
38 }
39
40 public ToStringFunction<String> getStringFunction() {
41 return stringFunction;
42 }
43}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…