Gaurav N
Gaurav N

Reputation: 405

How to pass options to this function?

How to pass options to the search function as described in the API section of nlcst-search.

search(node, patterns, handler[, allowApostrophes|options])

I want to pass allowDashes option to it. The code I currently have is:

search(node, patterns, handler);
function handler(){
//my code
}

I tried search(node, patterns, handler, allowDashes) but it fails. Any help appreciated.

Upvotes: 0

Views: 67

Answers (1)

Suraj Rao
Suraj Rao

Reputation: 29614

According to the docs,

options (Object) — Configuration: allowApostrophes (boolean, default: false) — Configuration for nlcst-normalize);
allowDashes(boolean, default: false) — Configuration for nlcst-normalize); allowLiterals(boolean, default: false) — Include literal phrases

options is an object with allowDashes as boolean.

Try:

search(node, patterns, handler, {allowDashes:true})

Upvotes: 4

Related Questions