cts:entity-dictionary-parse( $contents as xs:string*, [$options as xs:string*] ) as cts:entity-dictionary
Construct a cts:entity-dictionary
object by parsing it from a formatted string.
Parameters | |
---|---|
contents | The dictionary entries to parse. Each line (or string) must consist of four tab-delimited fields: The entity ID, the normalized form of the entity, the word or phrase to match during entity identification, and the entity type. For more details about the fields, see cts:entity. Multiple formatted strings can be passed in and they will be combined into a single dictionary object. |
options |
Dictionary building options. The default is case-sensitive, allow-overlaps,
and whole-words.
Options include:
|
cts:entity-dictionary-parse( $uri as xs:string ) as cts:entity-dictionary
Construct a cts:entity-dictionary
object by parsing it from a location in the database. The dictionary will be automatically cached for reuse.
Parameters | |
---|---|
uri | The URI of the entity dictionary that has previously been saved in the database. |
import module namespace entity = "http://marklogic.com/entity" at "/MarkLogic/entity.xqy"; xdmp:document-insert("/entities/example.txt", entity:skos-dictionary("http://example.org/ontology","en")) ; cts:entity-walk(doc("mydoc.xml"), <entity type="{$cts:entity-type}">{$cts:text}</entity>, cts:entity-dictionary-get("/entities/example.txt")) )