spell.makeDictionary( words as String[], [output-kind as String] ) as Item
Creates a dictionary node from a sequence of words.
const spell = require("/MarkLogic/spell"); const words = ["words", "to", "go", "in", "the", "dictionary"]; spell.makeDictionary(words) => { "words":[ "words", "to", "go", "in", "the", "dictionary" ] }
const spell = require("/MarkLogic/spell"); spell.makeDictionary(cts.words()) => A javascript object containing all the words in the database. Use spell.insert to insert this into the database as a dictionary. This example requires a word lexicon on the database. You can construct the sequence of words any way you like.