Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Hoang.

Asked: August 01, 2017 - 2:58 am UTC

Last updated: August 03, 2017 - 1:10 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi All,

I have questions about Oracle Text 12c. And I would like to have your supports on this.

1. Synonym of a word
For example, I have a word "REVEAL" and can I get all the synonyms of the REVEAL, such as: show, display, exhibit, disclose, uncover, unveil, uncloak ...

2. The past and present of a word
For example: made(past) => make (present), tried => try


Thanks in advance.

VN.

and Connor said...

You can use a thesaurus for that. You can create your own, or load one. We supply a default one which you can load under $ORACLE_HOME/ctx/sample, eg

C:\oracle\product\12.2.0.1\ctx\sample\thes>ctxload -thes -name default -file dr0thsus.txt
Enter user: mcdonac/******
Connecting...
Creating thesaurus default...
Thesaurus default created...
Processing...
1000 lines processed
2000 lines processed
3000 lines processed
4000 lines processed
5000 lines processed
6000 lines processed
7000 lines processed
8000 lines processed
9000 lines processed
10000 lines processed
11000 lines processed
12000 lines processed
13000 lines processed
14000 lines processed
15000 lines processed
16000 lines processed
17000 lines processed
18000 lines processed
19000 lines processed
20000 lines processed
21000 lines processed
21760 lines processed successfully
Beginning insert...21760 lines inserted successfully
Disconnected

SQL> create table t (col varchar2(60));

Table created.

SQL>
SQL> insert all
  2  into t values ('I abandoned all hope of losing weight')
  3  into t values ('We shall never surrender')
  4  select * from dual;

2 rows created.

SQL>
SQL> create index t_idx on t (col) INDEXTYPE IS CTXSYS.CONTEXT;

Index created.

SQL>
SQL> select * from t where contains (col, 'abandonment') > 0;

no rows selected

SQL> select * from t where contains (col, 'SYN(abandonment,default)') > 0;

COL
------------------------------------------------------------
I abandoned all hope of losing weight

1 row selected.


Plenty of good info here

https://docs.oracle.com/database/122/CCAPP/working-with-thesaurus-in-oracle-text.htm#CCAPP0900



Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Hoang Viet, August 02, 2017 - 8:31 am UTC

Hi Connor McDonald,

Thanks for your support.

Could you please give me more details example about my 2 questions ?

We need an API that can get the synonym of a Word (Verb,Noun...) and API to check the past & present of TERM also.


Thanks so much.
VN.
Connor McDonald
August 03, 2017 - 1:10 am UTC

The concept is no different. You have a word that should be aligned with other words.

The challenge is not the implementaton (as you've seen in the demo). The challenge is locating a sufficiently detailed thesaurus that meets your needs.

Hoang Viet, August 03, 2017 - 3:06 am UTC

thanks so much for your strong support, Connor McDonald.


VN.

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.