/src/spelling/corrector/CorrectorBuilder.java
Java | 23 lines | 19 code | 4 blank | 0 comment | 2 complexity | 13e28f1b7482c68a29ff6929eb1c151e MD5 | raw file
- package spelling.corrector;
-
-
- public class CorrectorBuilder {
- private static SpellingCorrectorHelper buildHelper(boolean isVerbose){
- SpellingCorrectorHelper helper = new DefaultSpellingCorrectorHelper();
- if(isVerbose){
- return new StatSpellingCorrectorHelper(helper);
- }else{
- return helper;
- }
- }
-
- public static SpellingCorrector buildCorrector(boolean isVerbose){
- SpellingCorrector corrector = new DefaultSpellingCorrector(buildHelper(isVerbose));
- if(isVerbose){
- return new StatSpellingCorrector(corrector);
- }else{
- return corrector;
- }
-
- }
- }