@@ -21,9 +21,9 @@ declare namespace map = "http://www.w3.org/2005/xpath-functions/map";
2121 : @param $match The match text for a snippet that contains highlighted text
2222 : @return A string with highlight spans encoded within the string
2323 :)
24- declare function ner:stringify ($match as node () ) as xs:string {
24+ declare function ner:stringify ($match) as xs:string {
2525 fn:string-join (
26- for $text-or-highlight in $match/ node ()
26+ for $text-or-highlight in $match
2727 return
2828 if ($text-or-highlight instance of element ())
2929 then
@@ -97,18 +97,14 @@ function ner:classify-node($node as node(), $language as xs:string) as node() {
9797 :)
9898declare
9999function ner:properties-from-language ($language as xs:string) as map (*) {
100- try {
101- switch ($language)
102- case "en" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-english.json" )
103- case "ar" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-arabic.json" )
104- case "es" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-spanish.json" )
105- case "fr" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-french.json" )
106- case "zh" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-chinese.json" )
107- case "de" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-german.json" )
108- default return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-english.json" )
109- } catch * {
110- fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-english.json" )
111- }
100+ switch ($language)
101+ case "en" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-english.json" )
102+ case "ar" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-arabic.json" )
103+ case "es" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-spanish.json" )
104+ case "fr" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-french.json" )
105+ case "zh" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-chinese.json" )
106+ case "de" return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-german.json" )
107+ default return fn:json-doc ("/db/apps/stanford-nlp/data/StanfordCoreNLP-english.json" )
112108};
113109
114110(:~
0 commit comments