Commit ef6d335131bb68e1c81e3623c4702babc5b62c3a

Authored by Bartłomiej Nitoń
1 parent 8b492eb0

Fix command line arguments error.

src/main/java/pl/waw/ipipan/zil/core/md/Main.java
... ... @@ -142,7 +142,7 @@ public class Main {
142 142 */
143 143 public static void main(String[] args) {
144 144  
145   - if (args.length != 2 && args.length != 3) {
  145 + if (args.length != 2 && args.length != 5) {
146 146 logger.error("Wrong usage! should be: " + Main.class.getSimpleName()
147 147 + " input_dir result_dir [head_model] [nominal_mention_model] [zero_subject_model]");
148 148 return;
... ... @@ -159,18 +159,19 @@ public class Main {
159 159 logger.error(outputDir + " is not a directory!");
160 160 return;
161 161 }
  162 +
162 163 if (args.length == 5) {
163 164 try {
164 165 InputStream headDetectionModelStream;
165   - headDetectionModelStream = new FileInputStream(new File(args[3]));
  166 + headDetectionModelStream = new FileInputStream(new File(args[2]));
166 167 headModel = new HeadDetector(headDetectionModelStream);
167 168  
168 169 InputStream nominalMentionsDetectionModelStream;
169   - nominalMentionsDetectionModelStream = new FileInputStream(new File(args[4]));
  170 + nominalMentionsDetectionModelStream = new FileInputStream(new File(args[3]));
170 171 nominalMentionModel = new NominalMentionDetector(nominalMentionsDetectionModelStream);
171 172  
172 173 InputStream zeroSubjectDetectionModelStream;
173   - zeroSubjectDetectionModelStream = new FileInputStream(new File(args[5]));
  174 + zeroSubjectDetectionModelStream = new FileInputStream(new File(args[4]));
174 175 zeroSubjectModel = new ZeroSubjectDetector(zeroSubjectDetectionModelStream);
175 176 } catch (IOException e) {
176 177 logger.error("Unable to load model: " + e, e);
... ...