MCPcopy Create free account
hub / github.com/baidu/lac / main

Method main

java/LacDemo.java:15–45  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

13 }
14
15 public static void main(String[] args) {
16
17 // 默认模型路径
18 String model_path = new String("./lac_model");
19
20 if (args.length > 0) {
21 model_path = args[0];
22 }
23
24 LAC lac = new LAC(model_path);
25
26 // 装载用户词典
27 if (args.length > 1) {
28 lac.loadCustomization(args[1]);
29 }
30
31 ArrayList<String> words = new ArrayList<>();
32 ArrayList<String> tags = new ArrayList<>();
33 BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
34 String query = null;
35
36 try {
37 while ((query = stdin.readLine()) != null) {
38 lac.run(query, words, tags);
39 System.out.println(words);
40 System.out.println(tags);
41 }
42 } catch (Exception e) {
43 System.out.println(e.getMessage());
44 }
45 }
46}

Callers

nothing calls this directly

Calls 2

loadCustomizationMethod · 0.95
runMethod · 0.95

Tested by

no test coverage detected