private static Map<String,Set<Integer>> readConfigFile(File configFile) throws IOException {
  Map<String,Set<Integer>> entries=new HashMap<>();
  for (  String line : FileUtils.readLines(configFile)) {
    String[] fields=line.split(FIELDSEPARATOR_CONFIGFILE);
    if (fields.length < 2) {
      throw new IllegalStateException(String.format("Could not parse config file '%s': Invalid line:%n%s",configFile,line));
    }
    if (entries.containsKey(fields[0])) {
      throw new IllegalStateException(String.format("Could not parse config file '%s': duplicate corpus entry '%s'.",configFile,fields[0]));
    }
    Set<Integer> topicCounts=new HashSet<>(fields.length - 1);
    for (int i=1; i < fields.length; i++) {
      try {
        topicCounts.add(Integer.parseInt(fields[i]));
      }
 catch (      NumberFormatException e) {
        throw new IllegalStateException(String.format("Could not parse config file '%s': Invalid topic number '%s'.",configFile,fields[i]));
      }
    }
    entries.put(fields[0],topicCounts);
  }
  return entries;
}

private static Map < String , Set < Integer > > readConfigFile ( File configFile ) throws IOException { Map < String , Set < Integer > > entries = new HashMap < > ( ) ; for ( String line : FileUtils . readLines ( configFile ) ) { String [ ] fields = line . split ( FIELDSEPARATOR_CONFIGFILE ) ; if ( fields . length < 2 ) { throw new IllegalStateException ( String . format ( "Could not parse config file '%s': Invalid line:%n%s" , configFile , line ) ) ; } if ( entries . containsKey ( fields [ 0 ] ) ) { throw new IllegalStateException ( String . format ( "Could not parse config file '%s': duplicate corpus entry '%s'." , configFile , fields [ 0 ] ) ) ; } Set < Integer > topicCounts = new HashSet < > ( fields . length - 1 ) ; for ( int i = 1 ; i < fields . length ; i ++ ) { try { topicCounts . add ( Integer . parseInt ( fields [ i ] ) ) ; } catch ( NumberFormatException e ) { throw new IllegalStateException ( String . format ( "Could not parse config file '%s': Invalid topic number '%s'." , configFile , fields [ i ] ) ) ; } } entries . put ( fields [ 0 ] , topicCounts ) ; } return entries ; }
read config file in the form < corpus > ; < ntopics > [ ; < ntopics > . . . ] < p > results in a map < corpusname > : set ( ntopics1 , . . . )
