gov.nih.nci.lexbig.ext
Class SearchUtil

java.lang.Object
  extended by gov.nih.nci.lexbig.ext.SearchUtil

public class SearchUtil
extends java.lang.Object


Field Summary
static int SEARCH_CONTAINS
           
static int SEARCH_ENDS_WITH
           
static int SEARCH_EXACT_MATCH
           
static int SEARCH_STARTS_WITH
           
 
Constructor Summary
SearchUtil(java.lang.String codingSchemeName, java.lang.String version, java.lang.String url)
           
 
Method Summary
static ConceptReferenceList createConceptReferenceList(java.lang.String[] codes, java.lang.String codeSystem)
           
 LexBIGService createLexBIGService(java.lang.String url)
           
 void dump_matches(ResolvedConceptReferencesIterator iterator, int maxToReturn)
           
 CodingScheme getCodingScheme(java.lang.String codingSchemeName, java.lang.String version)
           
 ResolvedConceptReferenceList getNext(ResolvedConceptReferencesIterator iterator)
           
 java.lang.String[] getPropertyForCodingSchemeSearch()
           
protected  float getReferenceWeight(ResolvedConceptReference ref, java.util.List matchWords)
          Return a relative weight between 0 and 1 that indicates how well the given reference maps to a set of words.
 java.util.Vector getSupportedAssociations()
           
protected  float getTextWeight(java.lang.String text, java.util.List<java.lang.String> matchWords)
          Return a relative weight between 0 and 1 that indicates how well the given string maps to a set of words.
static void main(java.lang.String[] args)
           
protected  java.util.Vector matchSpell(java.lang.String s, LexBIGService lbSvc, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String source)
          Attempt to approximate spelling suggestions.
protected  java.util.Vector matchSubquery(java.lang.String s, LexBIGService lbSvc, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String source)
          Attempt to approximate compositional or sub-query match.
protected  java.util.Vector matchSynonyms(java.lang.String s, LexBIGService lbSvc, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String source)
          Display concepts and related text strings matching the given string.
protected  java.util.Vector matchTermCompletion(java.lang.String s, LexBIGService lbSvc, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String source)
          Attempt to approximate term completion.
protected  java.util.Vector matchWordCompletion(java.lang.String s, LexBIGService lbSvc, java.lang.String scheme, CodingSchemeVersionOrTag csvt, java.lang.String source)
          Attempt to approximate word completion.
protected  CodedNodeSet restrictToSource(CodedNodeSet cns, java.lang.String source)
           
 void run()
           
 java.util.Vector searchNodes(java.lang.String scheme, java.lang.String version, java.lang.String tag, java.lang.String searchTerm, int limit, java.lang.String source, boolean cui, boolean shortResult, boolean score)
           
 ResolvedConceptReferencesIterator searchNodesForAssociations(java.util.List names, int count, boolean soundsLike, boolean includeObsolete, java.lang.String roleToSearchIn)
           
 ResolvedConceptReferencesIterator searchNodesForDefinition(java.util.List names, int count, boolean soundsLike, boolean searchInactive)
           
 ResolvedConceptReferencesIterator searchNodesForName(java.util.List names, int count, boolean soundsLike, boolean searchInactive, java.lang.String searchSource, java.lang.String roleToSearchIn, java.lang.String associationToSearchIn)
           
 ResolvedConceptReferencesIterator searchNodesForName(java.util.List names, int count, int algorithm, boolean soundsLike, boolean includeObsolete)
           
 ResolvedConceptReferencesIterator searchNodesForProperties(java.util.List names, int count, boolean soundsLike, boolean searchInactive)
           
 ResolvedConceptReferencesIterator searchNodesForProperties(java.util.List names, int count, boolean soundsLike, boolean searchInactive, java.lang.String searchSource, java.lang.String roleToSearchIn, java.lang.String associationToSearchIn)
           
 ResolvedConceptReferencesIterator searchNodesForProperties(java.util.List names, int count, int algorithm, java.lang.String[] properties, boolean soundsLike, boolean includeObsolete)
           
protected  java.lang.String[] toWords(java.lang.String s, boolean removeStopWords)
          Returns an array containing the individual white-space delimited words contained by the given string, removing stop words and normalizing to lower case.
 LocalNameList vector2LocalNameList(java.util.Vector v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_STARTS_WITH

public static final int SEARCH_STARTS_WITH
See Also:
Constant Field Values

SEARCH_ENDS_WITH

public static final int SEARCH_ENDS_WITH
See Also:
Constant Field Values

SEARCH_CONTAINS

public static final int SEARCH_CONTAINS
See Also:
Constant Field Values

SEARCH_EXACT_MATCH

public static final int SEARCH_EXACT_MATCH
See Also:
Constant Field Values
Constructor Detail

SearchUtil

public SearchUtil(java.lang.String codingSchemeName,
                  java.lang.String version,
                  java.lang.String url)
Method Detail

createLexBIGService

public LexBIGService createLexBIGService(java.lang.String url)

getSupportedAssociations

public java.util.Vector getSupportedAssociations()

getCodingScheme

public CodingScheme getCodingScheme(java.lang.String codingSchemeName,
                                    java.lang.String version)
                             throws java.lang.Exception
Throws:
java.lang.Exception

restrictToSource

protected CodedNodeSet restrictToSource(CodedNodeSet cns,
                                        java.lang.String source)

getPropertyForCodingSchemeSearch

public java.lang.String[] getPropertyForCodingSchemeSearch()

vector2LocalNameList

public LocalNameList vector2LocalNameList(java.util.Vector v)

searchNodesForDefinition

public ResolvedConceptReferencesIterator searchNodesForDefinition(java.util.List names,
                                                                  int count,
                                                                  boolean soundsLike,
                                                                  boolean searchInactive)

searchNodesForProperties

public ResolvedConceptReferencesIterator searchNodesForProperties(java.util.List names,
                                                                  int count,
                                                                  boolean soundsLike,
                                                                  boolean searchInactive)

searchNodesForProperties

public ResolvedConceptReferencesIterator searchNodesForProperties(java.util.List names,
                                                                  int count,
                                                                  boolean soundsLike,
                                                                  boolean searchInactive,
                                                                  java.lang.String searchSource,
                                                                  java.lang.String roleToSearchIn,
                                                                  java.lang.String associationToSearchIn)

searchNodesForProperties

public ResolvedConceptReferencesIterator searchNodesForProperties(java.util.List names,
                                                                  int count,
                                                                  int algorithm,
                                                                  java.lang.String[] properties,
                                                                  boolean soundsLike,
                                                                  boolean includeObsolete)

searchNodesForAssociations

public ResolvedConceptReferencesIterator searchNodesForAssociations(java.util.List names,
                                                                    int count,
                                                                    boolean soundsLike,
                                                                    boolean includeObsolete,
                                                                    java.lang.String roleToSearchIn)

searchNodesForName

public ResolvedConceptReferencesIterator searchNodesForName(java.util.List names,
                                                            int count,
                                                            int algorithm,
                                                            boolean soundsLike,
                                                            boolean includeObsolete)

searchNodesForName

public ResolvedConceptReferencesIterator searchNodesForName(java.util.List names,
                                                            int count,
                                                            boolean soundsLike,
                                                            boolean searchInactive,
                                                            java.lang.String searchSource,
                                                            java.lang.String roleToSearchIn,
                                                            java.lang.String associationToSearchIn)

getNext

public ResolvedConceptReferenceList getNext(ResolvedConceptReferencesIterator iterator)

dump_matches

public void dump_matches(ResolvedConceptReferencesIterator iterator,
                         int maxToReturn)

searchNodes

public java.util.Vector searchNodes(java.lang.String scheme,
                                    java.lang.String version,
                                    java.lang.String tag,
                                    java.lang.String searchTerm,
                                    int limit,
                                    java.lang.String source,
                                    boolean cui,
                                    boolean shortResult,
                                    boolean score)

matchSynonyms

protected java.util.Vector matchSynonyms(java.lang.String s,
                                         LexBIGService lbSvc,
                                         java.lang.String scheme,
                                         CodingSchemeVersionOrTag csvt,
                                         java.lang.String source)
                                  throws LBException
Display concepts and related text strings matching the given string.

Parameters:
s - The test string.
lbSvc -
scheme -
csvt -
source -
Throws:
LBException

matchSpell

protected java.util.Vector matchSpell(java.lang.String s,
                                      LexBIGService lbSvc,
                                      java.lang.String scheme,
                                      CodingSchemeVersionOrTag csvt,
                                      java.lang.String source)
                               throws LBException
Attempt to approximate spelling suggestions.

Parameters:
s - The test string.
lbSvc -
scheme -
csvt -
source -
Throws:
LBException

matchTermCompletion

protected java.util.Vector matchTermCompletion(java.lang.String s,
                                               LexBIGService lbSvc,
                                               java.lang.String scheme,
                                               CodingSchemeVersionOrTag csvt,
                                               java.lang.String source)
                                        throws LBException
Attempt to approximate term completion.

Parameters:
s - The test string.
lbSvc -
scheme -
csvt -
Throws:
LBException

matchWordCompletion

protected java.util.Vector matchWordCompletion(java.lang.String s,
                                               LexBIGService lbSvc,
                                               java.lang.String scheme,
                                               CodingSchemeVersionOrTag csvt,
                                               java.lang.String source)
                                        throws LBException
Attempt to approximate word completion.

Parameters:
s - The test string.
lbSvc -
scheme -
csvt -
source -
Throws:
LBException

matchSubquery

protected java.util.Vector matchSubquery(java.lang.String s,
                                         LexBIGService lbSvc,
                                         java.lang.String scheme,
                                         CodingSchemeVersionOrTag csvt,
                                         java.lang.String source)
                                  throws LBException
Attempt to approximate compositional or sub-query match.

Parameters:
s - The test string.
lbSvc -
scheme -
csvt -
source -
Throws:
LBException

getReferenceWeight

protected float getReferenceWeight(ResolvedConceptReference ref,
                                   java.util.List matchWords)
Return a relative weight between 0 and 1 that indicates how well the given reference maps to a set of words.

Parameters:
ref -
matchWords -

getTextWeight

protected float getTextWeight(java.lang.String text,
                              java.util.List<java.lang.String> matchWords)
Return a relative weight between 0 and 1 that indicates how well the given string maps to a set of words.

Parameters:
text -
matchWords -

createConceptReferenceList

public static ConceptReferenceList createConceptReferenceList(java.lang.String[] codes,
                                                              java.lang.String codeSystem)

toWords

protected java.lang.String[] toWords(java.lang.String s,
                                     boolean removeStopWords)
Returns an array containing the individual white-space delimited words contained by the given string, removing stop words and normalizing to lower case.

Parameters:
s -

run

public void run()

main

public static void main(java.lang.String[] args)


Copyright © 2007 National Cancer Institute (NCI). All Rights Reserved.