spell.makeDictionary( words as String[], [output-kind as String] ) as Item
Creates a dictionary node from a sequence of words.
var spell = require("/MarkLogic/spell"); var words = ["words", "to", "go", "in", "the", "dictionary"]; spell.makeDictionary(words) => { "words":[ "words", "to", "go", "in", "the", "dictionary" ] }
var 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.