| 53 | } |
| 54 | |
| 55 | int main(int argc, const char* argv[]) { |
| 56 | try { |
| 57 | TCLAP::CmdLine cmd("Open Chinese Convert (OpenCC) Phrase Extractor", ' ', |
| 58 | OPENCC_VERSION); |
| 59 | CmdLineOutput cmdLineOutput; |
| 60 | cmd.setOutput(&cmdLineOutput); |
| 61 | TCLAP::UnlabeledMultiArg<std::string> fileNames( |
| 62 | "fileName", "Input files", true /* required */, "files"); |
| 63 | cmd.add(fileNames); |
| 64 | TCLAP::ValueArg<std::string> outputArg( |
| 65 | "o", "output", "Output file", true /* required */, "" /* default */, |
| 66 | "file" /* type */, cmd); |
| 67 | cmd.parse(argc, argv); |
| 68 | Extract(fileNames.getValue(), outputArg.getValue()); |
| 69 | } catch (TCLAP::ArgException& e) { |
| 70 | std::cerr << "error: " << e.error() << " for arg " << e.argId() |
| 71 | << std::endl; |
| 72 | } catch (Exception& e) { |
| 73 | std::cerr << e.what() << std::endl; |
| 74 | } |
| 75 | return 0; |
| 76 | } |