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.