Oracle Text Reference Release 9.0.1 Part Number A90121-01 |
|
CTX_DOC Package , 3 of 10
Use the CTX_DOC.GIST procedure to generate a gist and theme summaries for a document. You can generate paragraph-level or sentence-level gists or theme summaries.
CTX_DOC.GIST(index_name IN VARCHAR2, textkey IN VARCHAR2, restab IN OUT CLOB, glevel IN VARCHAR2 DEFAULT 'P', pov IN VARCHAR2 DEFAULT 'GENERIC', numParagraphs IN NUMBER DEFAULT NULL, maxPercent IN NUMBER DEFAULT NULL, num_themes IN NUMBER DEFAULT 50);
CTX_DOC.GIST(index_name IN VARCHAR2, textkey IN VARCHAR2, restab IN VARCHAR2, query_id IN NUMBER DEFAULT 0, glevel IN VARCHAR2 DEFAULT 'P', pov IN VARCHAR2 DEFAULT NULL, numParagraphs IN NUMBER DEFAULT NULL, maxPercent IN NUMBER DEFAULT NULL, num_themes IN NUMBER DEFAULT 50);
Specify the name of the index associated with the text column containing the document identified by textkey
.
Specify the unique identifier (usually the primary key) for the document.
The textkey parameter can be one of the following:
You toggle between primary key and rowid identification using CTX_DOC.SET_KEY_TYPE.
You can specify that this procedure store the gist and theme summaries to either a table or to an in-memory CLOB.
To store results to a table specify the name of the table.
See Also:
"Gist Table" in Appendix A, "Result Tables" for more information about the structure of the gist result table, see |
To store results in memory, specify the name of the CLOB locator. If restab is NULL, a temporary CLOB is allocated and returned. You must de-allocate the locator after using it.
If restab
is not NULL, the CLOB is truncated before the operation.
Specify an identifier to use to identify the row(s) inserted into restab
.
Specify the type of gist or theme summary to produce. The possible values are:
The default is P.
Specify whether a gist or a single theme summary is generated. The type of gist or theme summary generated (sentence-level or paragraph-level) depends on the value specified for glevel
.
To generate a gist for the entire document, specify a value of `GENERIC' for pov
. To generate a theme summary for a single theme in a document, specify the theme as the value for pov
.
When using result table storage and you do not specify a value for pov
, this procedure returns the generic gist plus up to fifty theme summaries for the document.
When using in-memory result storage to a CLOB, you must specify a pov
. However, if you do not specify pov
, this procedure generates only a generic gist for the document.
Specify the maximum number of document paragraphs (or sentences) selected for the document gist or theme summaries. The default is 0.
Specify the maximum number of document paragraphs (or sentences) selected for the document gist or theme summaries as a percentage of the total paragraphs (or sentences) in the document. The default is 0.
Specify the number of theme summaries to produce when you do not specify a value for pov
. For example, if you specify 10, this procedure returns the top 10 theme summaries. The default is 50.
If you specify 0 or NULL, this procedure returns all themes in a document. If the document contains more than 50 themes, only the top 50 themes show conceptual hierarchy.
The following example generates a non-default size generic gist of at most 10 paragraphs. The result is stored in memory in a CLOB locator. The code then de-allocates the returned CLOB locator after using it.
set serveroutput on; declare gklob clob; amt number := 40; line varchar2(80); begin ctx_doc.gist('newsindex','34',gklob, pov => 'GENERIC',numParagraphs => 10); -- gklob is NULL when passed-in, so ctx-doc.gist will allocate a temporary -- CLOB for us and place the results there. dbms_lob.read(gklob, amt, 1, line); dbms_output.put_line('FIRST 40 CHARS ARE:'||line); -- have to de-allocate the temp lob dbms_lob.freetemporary(gklob); end;
The following example creates a gist table called CTX_GIST:
create table CTX_GIST (query_id number, pov varchar2(80), gist CLOB);
The following example returns a default sized paragraph level gist for document 34 as well as the top 10 theme summaries in the document:
begin ctx_doc.gist('newsindex','34','CTX_GIST', 1, num_themes=10); end;
The following example generates a non-default size gist of at most 10 paragraphs:
begin ctx_doc.gist('newsindex','34','CTX_GIST',1,pov =>'GENERIC',numParagraphs=>10); end;
The following example generates a gist whose number of paragraphs is at most 10 percent of the total paragraphs in document:
begin ctx_doc.gist('newsindex','34','CTX_GIST',1,pov => 'GENERIC', maxPercent => 10); end;
The following example returns a paragraph level theme summary for insects for document 34. The default theme summary size is returned.
begin ctx_doc.gist('newsindex','34','CTX_GIST',1, pov => 'insects'); end;
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|