throw new MissingParameterException("class");
}
List<Alignment> alignmentList = new ArrayList<Alignment>();
if (cls.equals("al")) {
if (commandLine.getArgs().length < 1) {
throw new WrongArgumentCountException("1, 2, 3, ...", commandLine.getArgs().length);
}
for (String fileName : commandLine.getArgs()) {
Reader reader = getReader(getFileInputStream(fileName));
Parser parser = new AlParser(reader);
List<Alignment> currentAlignmentList = parser.parse();
alignmentList.addAll(currentAlignmentList);
reader.close();
}
} else if (cls.equals("txt")) {
if ((commandLine.getArgs().length % 2) != 0) {
throw new WrongArgumentCountException("2, 4, 6, ...", commandLine.getArgs().length);
}
for (int i = 0; i < commandLine.getArgs().length; i += 2) {
String sourceFileName = commandLine.getArgs()[i];
String targetFileName = commandLine.getArgs()[i + 1];
Reader sourceReader = getReader(getFileInputStream(sourceFileName));
Reader targetReader = getReader(getFileInputStream(targetFileName));
Parser parser = new PlaintextParser(sourceReader, targetReader);
List<Alignment> currentAlignmentList = parser.parse();
alignmentList.addAll(currentAlignmentList);
sourceReader.close();
targetReader.close();
}
} else if (cls.equals("tmx")) {
if (commandLine.getArgs().length < 1) {
throw new WrongArgumentCountException("1, 2, 3, ...", commandLine.getArgs().length);
}
String languages = commandLine.getOptionValue('l');
String[] languageArray;
if (languages == null) {
languageArray = new String[0];