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

Method run

java/LacMulti.java:52–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 private Lock readLock = new ReentrantLock();
51
52 public void run() {
53 ArrayList<String> words = new ArrayList<>();
54 ArrayList<String> tags = new ArrayList<>();
55 BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
56 String query = null;
57
58 try {
59 LAC thread_lac = new LAC(g_lac);
60 while (true) {
61 readLock.lock();
62 if ((query = stdin.readLine()) == null){
63 readLock.unlock();
64 break;
65 }
66 readLock.unlock();
67 thread_lac.run(query, words, tags);
68
69 printLock.lock();
70 System.out.println(words);
71 System.out.println(tags);
72 printLock.unlock();
73 }
74 } catch (Exception e) {
75 System.out.println(e.getMessage());
76 }
77 }
78}

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected