public static void loadProfiles(String... langs) throws LangDetectException {
    	
    	for(int i=0; i<langs.length;i++){
    	
    		InputStream is = LangProfile.class.getClassLoader()
    				.getResourceAsStream("profiles/"+langs[i]);
    
            try {
                LangProfile profile = JSON.decode(is, LangProfile.class);
                addProfile(profile, langs.length);
            } catch (JSONException e) {
                throw new LangDetectException(ErrorCode.FormatError, "profile format error in for: "+langs[i]);
            } catch (IOException e) {
            	throw new LangDetectException(ErrorCode.FormatError, "profile format error in for: "+langs[i]);
			} finally {
                try {
                    if (is!=null) is.close();
                } catch (IOException e) {}
            }
        
    	}
    }