]> gitweb.fperrin.net Git - DictionaryPC.git/blob - src/com/hughes/android/dictionary/engine/Runner.java
Also support CheckDictionariesMain in Runner.
[DictionaryPC.git] / src / com / hughes / android / dictionary / engine / Runner.java
1 // Copyright 2020 Reimar Döffinger. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 package com.hughes.android.dictionary.engine;
16
17 import java.util.Arrays;
18
19 public class Runner {
20     public static void main(final String[] args) throws Exception {
21         if (args.length == 0) {
22             System.out.println("Specify WiktionarySplitter, DictionaryBuilder or ConvertToV6 as first argument");
23             return;
24         }
25         String[] newargs = Arrays.copyOfRange(args, 1, args.length);
26         if (args[0].equals("WiktionarySplitter")) {
27             WiktionarySplitter.main(newargs);
28         } else if (args[0].equals("DictionaryBuilder")) {
29             DictionaryBuilder.main(newargs);
30         } else if (args[0].equals("ConvertToV6")) {
31             ConvertToV6.main(newargs);
32         } else if (args[0].equals("CheckDictionariesMain")) {
33             CheckDictionariesMain.main(newargs);
34         } else {
35             System.out.println("Unknown command '" + args[0] + "'. Use one of WiktionarySplitter, DictionaryBuilder, ConvertToV6 or CheckDictionariesMain instead.");
36         }
37     }
38 }