MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / main

Function main

src/tools/PhraseExtract.cpp:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55int 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}

Callers

nothing calls this directly

Calls 8

setOutputMethod · 0.80
errorMethod · 0.80
argIdMethod · 0.80
ExtractFunction · 0.70
addMethod · 0.45
parseMethod · 0.45
getValueMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected