POLICY_STEMS
Extracts stems for each word in a body of text. This procedure is for use with AUTO_LEXER. This procedure can only use the languages supported by AUTO_LEXER, which are listed under “POLICY_LANGUAGES”.
Syntax
exec CTX_DOC.POLICY_STEMS (
policy_name in varchar2,
document in varchar2 | CLOB,
restab in out nocopy ctx_doc.stem_group_tab,
language in varchar2 default NULL,
format in varchar2 default NULL,
charset in varchar2 default NULL
);
policy_name
A policy that was previously created using the CTX_DDL.CREATE_POLICY method. If the specified policy includes a HTML_SECTION_GROUP sectioning preference, the API will honor the sectioning preference. For instance, if HTML sectioning is specified, HTML tags will be removed before processing the input document.
Note that the policy must use AUTO_LEXER only.
document
A body of text for which the languages are to be extracted. The text is assumed to be plain text with UTF-8 character encoding.
restab
The result of the stem extraction process. The returned values in the PL/SQL table will have one cell for each word in the input string document. Each word can be a multi-word as determined by the lexer. For each word, all the stems (including all alternate stems) are returned. For each stem, the offset and the length (in the input string) of the word for which this is a stem is returned. Additionally, for each stem, a Boolean value is returned that indicates if the stem was found in the lexicon.
stem_group_tab is a table of stem_group_records.
language
The language of the input text. The language string can be one of the values specified in the previous section on language extraction. If this parameter is null, the language will be automatically detected. There is a cost associated with language detection. So, if the language is known, it is best to supply the language value. See “POLICY_LANGUAGES” for the list of languages.
format
The format of the input text.
charset
The character set of the input text.
Restrictions and Notes
The stem extraction process supports certain nonstandard word forms-e.g. capitalization errors-as well as standard forms, and thus can be used to process informal or imperfect text (such as email, online documents, or queries). It also handles some variations in the text including case variation, hyphenation and unaccented characters among others.
The stem extraction process does not break compound words, but instead separates compound words with a # character. Such compound words are common in German. For instance, the German compound word Bildungsroman (from Bildung “education” and Roman “novel”) yields a single stem Bildungs#roman instead of two stems Bildungs and roman.