
cts:entity-dictionary( $entities as cts:entity*, [$options as xs:string*] ) as cts:entity-dictionary
Returns a cts:entity-dictionary object.
Use this function when creating ad hoc entity dictionaries, or as a prelude to saving an entity dictionary to the database.
xquery version "1.0-ml";
let $dict :=
cts:entity-dictionary(
for $alt in ("ACA", "Obamacare", "Affordable Care Act")
return cts:entity("E1", "ACA", $alt, "Law")
)
return
cts:entity-highlight(<node>ACA is often called Obamacare</node>,
element {$cts:entity-type} {attribute norm {$cts:normalized-text},
$cts:text}, $dict)
(: Returns output such as the following:
:
: <node><Law norm="ACA">ACA</Law> is often called <Law norm="ACA">Obamacare</Law></node>
:)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.