-
Notifications
You must be signed in to change notification settings - Fork 68
/
link-grammar-server.sh
executable file
·38 lines (35 loc) · 1.43 KB
/
link-grammar-server.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
# Shell script to start the link-grammar network server.
#
# Usage: java org.linkgrammar.LGService [-verbose] [-threads n] port [language] [dictPath]
# Start a link-grammar parse server on tcp/ip port. The server returns
# JSON-formated parse results. Socket input should be a single sentence
# to parse, preceeded by the identifier "text:".
#
# 'port' The TCP port the service should listen to.
# -verbose Generate verbose output.
# -threads Number of concurrent threads/clients allowed (default 1).
# 'language' Language abbreviation (en, ru, de, lt or fr).
# 'dictPath' Full path to the Link-Grammar dictionaries.
#
# The below starts the server on port 9000. It the port is ommitted,
# help text is printed. This server can be contacted directly via
# tcpip; for example:
#
# telnet localhost 9000
#
# (Alternately, use netcat instead of telnet). After connecting, type
# in:
#
# text: this is an example sentence to parse
#
# The returned bytes will be a JSON message providing the parses of
# the sentence. By default, the ASCII-art parse of the text is not
# transmitted. This can be obtained by sending messages of the form:
#
# storeDiagramString:true, text: this is a test.
export LANG=en_US.UTF-8
VM_OPTS="-Xmx1024m -Djava.library.path=/usr/lib:/usr/lib/jni:/usr/local/lib:/usr/local/lib/jni"
CLASSPATH='-classpath ./target/classes:./target/lib/*'
java $VM_OPTS $CLASSPATH org.linkgrammar.LGService 9000