Skip to content

Commit e19f3bf

Browse files
authored
Merge pull request #13 from duncdrum/feat-v4.2
feat(v4): upgrade corenlp to v4.2.0
2 parents 369c92d + d5e8656 commit e19f3bf

File tree

9 files changed

+26
-19
lines changed

9 files changed

+26
-19
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>org.exist-db</groupId>
1414
<artifactId>stanford-nlp</artifactId>
15-
<version>0.6.0-SNAPSHOT</version>
15+
<version>0.7.0-SNAPSHOT</version>
1616

1717
<name>Stanford Natural Language Processing</name>
1818
<description>Integrates the Stanford CoreNLP annotation pipeline library into eXist-db.</description>
@@ -64,7 +64,7 @@
6464
<exist.version>5.0.0</exist.version>
6565
<node.version>v12.22.1</node.version>
6666
<npm.version>7.9.0</npm.version>
67-
<corenlp.version>3.9.2</corenlp.version>
67+
<corenlp.version>4.2.0</corenlp.version>
6868
<!-- See polymer-cli documentation -->
6969
<browser.support>es5-bundled</browser.support>
7070

src/main/polymer/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/polymer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "polymer-starter-kit",
3-
"version": "0.6.0-SNAPSHOT",
3+
"version": "0.7.0-SNAPSHOT",
44
"description": "A starting point for Polymer apps",
55
"author": "The Polymer Authors",
66
"license": "BSD-3-Clause",

src/main/xar-resources/modules/load-language.xqm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import module namespace console = "http://exist-db.org/xquery/console";
88
import module namespace functx = "http://www.functx.com";
99
import module namespace util = "http://exist-db.org/xquery/util";
1010
import module namespace map = "http://www.w3.org/2005/xpath-functions/map";
11+
import module namespace xmldb = "http://exist-db.org/xquery/xmldb";
1112

1213
declare function ll:mkcol-recursive($collection, $components) {
1314
if (exists($components)) then

src/main/xar-resources/modules/load-languages.xq

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
xquery version "3.1";
22

33
import module namespace ll = "http://exist-db.org/xquery/stanford-nlp/load-language" at "load-language.xqm";
4+
import module namespace config = "http://exist-db.org/apps/stanford-nlp/config";
45

56

67
let $paths := (
7-
"http://nlp.stanford.edu/software/stanford-english-corenlp-2018-10-05-models.jar",
8-
"http://nlp.stanford.edu/software/stanford-english-kbp-corenlp-2018-10-05-models.jar",
9-
"http://nlp.stanford.edu/software/stanford-arabic-corenlp-2018-10-05-models.jar",
10-
"http://nlp.stanford.edu/software/stanford-chinese-corenlp-2018-10-05-models.jar",
11-
"http://nlp.stanford.edu/software/stanford-french-corenlp-2018-10-05-models.jar",
12-
"http://nlp.stanford.edu/software/stanford-german-corenlp-2018-10-05-models.jar",
13-
"http://nlp.stanford.edu/software/stanford-spanish-corenlp-2018-10-05-models.jar",
8+
$config:corenlp-model-url || "arabic.jar",
9+
$config:corenlp-model-url || "chinese.jar",
10+
$config:corenlp-model-url || "english.jar",
11+
$config:corenlp-model-url || "english-kbp.jar",
12+
$config:corenlp-model-url || "french.jar",
13+
$config:corenlp-model-url || "german.jar",
14+
$config:corenlp-model-url || "spanish.jar",
1415
()
1516
)
1617

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
xquery version "3.1";
22

33
import module namespace scheduler = "http://exist-db.org/xquery/scheduler";
4+
import module namespace config = "http://exist-db.org/apps/stanford-nlp/config";
45

5-
let $param := <parameters><param name="path" value="http://nlp.stanford.edu/software/stanford-chinese-corenlp-2018-10-05-models.jar"/></parameters>
6+
let $param := <parameters><param name="path" value="{$config:corenlp-model-url || 'chinese.jar'}"/></parameters>
67

78
return scheduler:schedule-xquery-periodic-job("/db/apps/stanford-nlp/module/schedule-load.xq", 500, "load chinese", $param, 500, 0)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
xquery version "3.1";
22

33
import module namespace ll = "http://exist-db.org/xquery/stanford-nlp/load-language" at "load-language.xqm";
4+
import module namespace config = "http://exist-db.org/apps/stanford-nlp/config";
45

5-
declare variable $local:path external := "http://nlp.stanford.edu/software/stanford-english-corenlp-2018-10-05-models.jar";
6+
declare variable $local:path external := $config:corenlp-model-url || 'english.jar';
67

78
ll:process($local:path)

src/main/xquery/config.xqm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ declare variable $config:repo-descriptor := doc(concat($config:app-root, "/repo.
3333

3434
declare variable $config:expath-descriptor := doc(concat($config:app-root, "/expath-pkg.xml"))/expath:package;
3535

36-
3736
declare variable $config:data-root := concat($config:app-root, "/data");
3837

38+
(: TODO(DP): use maven templating to construct version here :)
39+
declare variable $config:corenlp-version := '4.2.0';
40+
declare variable $config:corenlp-model-url := 'http://nlp.stanford.edu/software/stanford-corenlp-' || $config:corenlp-version ||'-models-';
41+
3942
(:~
4043
: Resolve the given path using the current application context.
4144
: If the app resides in the file system,

xar-assembly.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@
6969
<dependencySet>
7070
<groupId>edu.stanford.nlp</groupId>
7171
<artifactId>stanford-corenlp</artifactId>
72-
<version>3.9.2</version>
72+
<version>${corenlp.version}</version>
7373
</dependencySet>
7474
<dependencySet>
7575
<groupId>edu.stanford.nlp</groupId>
7676
<artifactId>stanford-corenlp</artifactId>
77-
<version>3.9.2</version>
77+
<version>${corenlp.version}</version>
7878
<classifier>models</classifier>
7979
</dependencySet>
8080
<!-- <dependencySet>-->
8181
<!-- <groupId>edu.stanford.nlp</groupId>-->
8282
<!-- <artifactId>stanford-corenlp</artifactId>-->
83-
<!-- <version>3.9.2</version>-->
83+
<!-- <version>${corenlp.version}</version>-->
8484
<!-- <classifier>models-english</classifier>-->
8585
<!-- </dependencySet>-->
8686
<!-- <dependencySet>-->
8787
<!-- <groupId>edu.stanford.nlp</groupId>-->
8888
<!-- <artifactId>stanford-corenlp</artifactId>-->
89-
<!-- <version>3.9.2</version>-->
89+
<!-- <version>${corenlp.version}</version>-->
9090
<!-- <classifier>models-english-kbp</classifier>-->
9191
<!-- </dependencySet>-->
9292
<dependencySet>

0 commit comments

Comments
 (0)