private void parseArguments(String[] args) throws IOException {
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    if (arg.equals("-i")) {
      i++;
      if (args.length <= i) {
        parsingError(arg + " requires an argument that was not provided.");
      }
      indirectory=new File(args[i]);
      if (!indirectory.exists()) {
        parsingError(args[i] + " did not exist, the input directory must exist and contain plain text data files.");
      }
    }
 else     if (arg.equals("-o")) {
      i++;
      if (args.length <= i) {
        parsingError(arg + " requires an argument that was not provided.");
      }
      outdirectory=new File(args[i]);
    }
 else     if (arg.equals("-c")) {
      i++;
      if (args.length <= i) {
        parsingError(arg + " requires an argument that was not provided.");
      }
      File config=new File(args[i]);
      if (!config.exists()) {
        parsingError(arg + "The config file specified, \"" + args[i]+ "\" did not exist.");
      }
      nerAnnotator=NerAnnotatorManager.buildNerAnnotator(new ResourceManager(args[i]),ViewNames.NER_CONLL);
    }
 else     if (arg.equals("-t")) {
      i++;
      try {
        max=Integer.parseInt(args[i]);
      }
 catch (      NumberFormatException nfe) {
        parsingError("\"-t\" must be followed by an integer number to limit the number of threads, \"" + args[i] + "\" is not numberic.");
      }
    }
 else {
      parsingError("\"" + arg + "\" is not a valid command line argument.");
    }
  }
  if (nerAnnotator == null) {
    parsingError("A configuration file must be specified with the \"-c\" option.");
  }
  if (outdirectory != null && !outdirectory.exists()) {
    if (indirectory == null)     outdirectory.createNewFile();
 else     if (indirectory.isDirectory()) {
      outdirectory.mkdirs();
    }
 else {
      outdirectory.createNewFile();
    }
  }
}

private void parseArguments ( String [ ] args ) throws IOException { for ( int i = 0 ; i < args . length ; i ++ ) { String arg = args [ i ] ; if ( arg . equals ( "-i" ) ) { i ++ ; if ( args . length <= i ) { parsingError ( arg + " requires an argument that was not provided." ) ; } indirectory = new File ( args [ i ] ) ; if ( ! indirectory . exists ( ) ) { parsingError ( args [ i ] + " did not exist, the input directory must exist and contain plain text data files." ) ; } } else if ( arg . equals ( "-o" ) ) { i ++ ; if ( args . length <= i ) { parsingError ( arg + " requires an argument that was not provided." ) ; } outdirectory = new File ( args [ i ] ) ; } else if ( arg . equals ( "-c" ) ) { i ++ ; if ( args . length <= i ) { parsingError ( arg + " requires an argument that was not provided." ) ; } File config = new File ( args [ i ] ) ; if ( ! config . exists ( ) ) { parsingError ( arg + "The config file specified, \"" + args [ i ] + "\" did not exist." ) ; } nerAnnotator = NerAnnotatorManager . buildNerAnnotator ( new ResourceManager ( args [ i ] ) , ViewNames . NER_CONLL ) ; } else if ( arg . equals ( "-t" ) ) { i ++ ; try { max = Integer . parseInt ( args [ i ] ) ; } catch ( NumberFormatException nfe ) { parsingError ( "\"-t\" must be followed by an integer number to limit the number of threads, \"" + args [ i ] + "\" is not numberic." ) ; } } else { parsingError ( "\"" + arg + "\" is not a valid command line argument." ) ; } } if ( nerAnnotator == null ) { parsingError ( "A configuration file must be specified with the \"-c\" option." ) ; } if ( outdirectory != null && ! outdirectory . exists ( ) ) { if ( indirectory == null ) outdirectory . createNewFile ( ) ; else if ( indirectory . isDirectory ( ) ) { outdirectory . mkdirs ( ) ; } else { outdirectory . createNewFile ( ) ; } } }
parse the arguments , only the directory .
