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

SPT - Recursive Permutation Design

I. Introduction
This section describes the method to find all permutations with synonyms from pattern permutation results, recursively.

II. Algorithm

  • Get the recursive level
  • Put inTerm into inTerms
  • Go through all recursive levels
    • go through all inTerms
      • Get synonyms from permutation results
      • Add synonyms permutations to accumulated results
    • Set inTerms to synonyms permutations

III. Java Classes & Method

  • Spt.java: a Java class for finding all permutation
  • public Vector<String> GetSynonymPermutationRecursive( )

IV. Examples

  • Inputs:
    • inTerm: dog
    • recursive level: 2

  • Algorithm:

    Recursive levelPattern (word|synonyms)
    1dog|canine|k9|bull dog|
    2bull|
    dog|canine|k9|bull dog|

  • Outputs:
    • dog
    • canine
    • k9
    • bull dog
    • bull canine
    • bull k9
    • bull bull dog