Loading TOC...

cts.partOfSpeech

cts.partOfSpeech(
   token as cts.token
) as String

Summary

Returns the part of speech for a cts:token, if any.

Parameters
token A token, as returned from cts.tokenize.

Usage Notes

This function is useful for testing custom tokenizers. Built in tokenizers do not use parts of speech and will return an empty string for the part of speech.

Example

const res = new Array();
for (const x of cts.tokenize("an example","en")) {
  res.push(cts.partOfSpeech(x))
};
res
=> ["","",""]

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.