Because of a lapse in government funding, the information on this website may not be up to date, transactions submitted via the website may not be processed, and the agency may not be able to respond to inquiries until appropriations are enacted. The NIH Clinical Center (the research hospital of NIH) is open. For more details about its operating status, please visit cc.nih.gov. Updates regarding government operating status and resumption of normal operations can be found at OPM.gov.

Lexical Tools

Application: Synonym Permutation Tool

I. Objective

To replace words/terms with synonyms in a free text.

This example shows a simple application to

  • Retrieve synonyms of words/terms in a free text
  • Permutation of replacing words/terms with synonyms

For example, if the synonyms list are:

dogcanine
catfeline
canineK9
K9bull dog
dog and catpets

Input term:

  • dog and cat

Output results:

  • dog and cat
  • dog and feline
  • canine and cat
  • canine and feline
  • k9 and cat
  • k9 and feline
  • pets

Please refer to design documents for details.

II. Pre-Requirements
None.

III. Source Code

  • Spt.java

IV. Compile

shell>cd ${SynonymPermutationTool}
shell>ant

V. Run & Results

shell> cd bin
shell> spt 
====== Synonym Permutation Generation ======
- debug flag: false
- synonyms file: /export/home/lu/Development/LVG/Components/Applications/SynonymPermutationTool/data/Spt/test.data
- recursive flag: true
- recursive level: 1
============================================
Please input a term (Quit = q) > dog and cat
-- Read through 16 lines and found 3 pairs of synonym.
----- Synonyms permutation results ------
dog and cat
dog and feline
canine and cat
canine and feline
k9 and cat
k9 and feline
pets

VI. Application Package Download

The whole package, SynonymPermutationTool.tgz can be down here.