Oracle8i interMedia Text Reference
Release 2 (8.1.6)

Part Number A77063-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

CTX_THES Package, 25 of 26


TRSYN

For a given mono-lingual thesuarus, this function returns the foreign equivalent of a phrase, synonyms of the phrase, and foreign equivalent of the synonyms as recorded in the specified thesaurus.


Note:

Foreign language translation is not part of the ISO-2788 or ANSI Z39.19 thesaural standards. The behavior of TRSYN is specific to interMedia Text.  


Syntax 1: Table Result

CTX_THES.TRSYN(restab IN OUT NOCOPY EXP_TAB,
               phrase IN VARCHAR2, 
               lang   IN VARCHAR2 DEFAULT NULL,
               tname  IN VARCHAR2 DEFAULT 'DEFAULT');

Syntax 2: String Result

CTX_THES.TRSYN(phrase IN VARCHAR2, 
            lang   IN VARCHAR2 DEFAULT NULL,
            tname  IN VARCHAR2 DEFAULT 'DEFAULT') 
RETURN VARCHAR2;
restab

Optionally, specify the name of the expansion table to store the results. This table must be of type EXP_TAB which the system defines as follows:

type exp_rec is record (
    xrel varchar2(12),
    xlevel number,
    xphrase varchar2(256)
);
type exp_tab is table of exp_rec index by binary_integer;

See Also:

For more information about EXP_TAB, see "CTX_THES Result Tables and Data Types" in Appendix B, "Result Tables".  

phrase

Specify phrase to lookup in thesaurus.

lang

Specify the foreign language. Specify 'ALL' for all translations of phrase.

tname

Specify thesaurus name. If not specified, system default thesaurus is used.

Returns

This function returns a string of foreign terms in the form:

 {ft1}|{ft2}|{ft3} ...

Example

Consider a thesaurus MY_THES with the following entries for cat:

cat 
  SPANISH: gato 
  FRENCH:  chat 
  SYN lion 
    SPANISH: leon 

To look up the translation and synonyms for cat, you can issue the following statements:

declare 
  synonyms   varchar2(2000);
  span_syn   varchar2(2000); 
begin 
  synonyms := ctx_thes.trsyn('CAT','ALL','MY_THES'); 
  span_syn := ctx_thes.trsyn('CAT','SPANISH','MY_THES') 
  dbms_output.put_line('all synonyms for CAT are: '||synonyms); 
  dbms_output.put_line('the Spanish synonyms for CAT are: '||span_syn); 
end; 
 

This codes produces the following output:

all synonyms for CAT are: {CAT}|{CHAT}|{GATO}|{LION}|{LEON} 
the Spanish synonyms for CAT are: {CAT}|{GATO}|{LION}|{LEON} 

Related Topics

OUTPUT_STYLE

Translation Term Synonym (TRSYN) Operator in Chapter 4



Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index