public static void loadProfile(List<String> json_profiles) throws LangDetectException {
  int index=0;
  int langsize=json_profiles.size();
  if (langsize < 2)   throw new LangDetectException(ErrorCode.NeedLoadProfileError,"Need more than 2 profiles");
  for (  String json : json_profiles) {
    try {
      LangProfile profile=JSON.decode(json,LangProfile.class);
      addProfile(profile,index,langsize);
      ++index;
    }
 catch (    JSONException e) {
      throw new LangDetectException(ErrorCode.FormatError,"profile format error");
    }
  }
}

public static void loadProfile ( List < String > json_profiles ) throws LangDetectException { int index = 0 ; int langsize = json_profiles . size ( ) ; if ( langsize < 2 ) throw new LangDetectException ( ErrorCode . NeedLoadProfileError , "Need more than 2 profiles" ) ; for ( String json : json_profiles ) { try { LangProfile profile = JSON . decode ( json , LangProfile . class ) ; addProfile ( profile , index , langsize ) ; ++ index ; } catch ( JSONException e ) { throw new LangDetectException ( ErrorCode . FormatError , "profile format error" ) ; } } }
load profiles from specified directory . this method must be called once before language detection .
