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.

Sub-Term Mapping Tools

Sub-Term APIs - Term in Corpus Design

I. Introduction
This section describes the sub-term methods used to find a term in a corpus tree.

II. Algorithm

  • Add " $_END_STR" (the END node)
  • Tokenize normalized term into inWords as a Vector<String>
  • Set the curNode to ROOT node
  • Set findFlag = false
  • Go through the inWords
    • Initiate curWordNode by the curWord
    • get curChilds from curNode
    • Check if curChilds contains curWordNode
      • yes => Check if curWordNode is END NODE
        • yes => match, set findFlag = true, break
      • update curNode
      • no => not match (false), break

III. Java Classes & Methods

  • SubtermApi.java: a Java class for sub-term methods
    • public static boolean FindTerm(String inTerm, Corpus corpus)

IV. Examples

  • Synonym Rules:

    wordsynonym
    dogcanine
    catfeline
    canineK9
    K9bull dog
    Dog and catpets
    puppy and kittypets

  • Synonym Terms:

    Terms
    dog
    canine
    cat
    feline
    k9
    bull dog
    dog and cat
    pets
    puppy and kitty

  • Input Term:
    Dog and cat
    • Normalized: dog and cat $_END
    • Go through each word of "dog and cat $_END"
      icurWordNodecurNodecurChilds.contains(curWordNode)END_NODEfindFlag
      0dogROOTtruefalsefalse
      1anddogtruefalsefalse
      2catandtruefalsefalse
      3$_ENDcattruetruetrue

  • Output: True

  • Corpus Tree