private LanguageDetector makeDetector ( ) throws IOException { double alpha = getParamDouble ( "alpha" , DEFAULT_ALPHA ) ; String profileDirectory = requireParamString ( "directory" ) + "/" ; Optional < Long > seed = Optional . fromNullable ( getParamLongOrNull ( "seed" ) ) ; List < LanguageProfile > languageProfiles = new LanguageProfileReader ( ) . readAll ( new File ( profileDirectory ) ) ; return LanguageDetectorBuilder . create ( NgramExtractors . standard ( ) ) . alpha ( alpha ) . seed ( seed ) . shortTextAlgorithm ( 50 ) . withProfiles ( languageProfiles ) . build ( ) ; }
Using all language profiles from the given directory .