software/test/performance/src/org/LexGrid/LexBIG/example/MetaMatch.java
/**
	 * Attempt to approximate compositional or sub-query match (e.g., "peptic ulcer"
	 * will match the two separate concepts for "peptic" and "ulcer", in case the
	 * ontology does not contain any concept matching the full text "peptic ulcer").
	 * @param s The test string.
	 * @param lbSvc
	 * @param scheme
	 * @param csvt
	 * @throws LBException
	 */
Attempt to approximate compositional or sub-query match .
@param s The test string.
Attempt to approximate compositional or sub - query match . @param s The test string .
protected void matchSubquery(String s, EVSApplicationService lbSvc, String scheme, CodingSchemeVersionOrTag csvt)
		throws LBException
	{
		Util.displayMessage("\n*** Subquery match (incorporates partial normalization/stemming).");
		StringBuffer searchPhrase = new StringBuffer();
		String[] words = toWords(s, true);
		for (int i = 0; i < words.length; i++) {
			if (i > 0)
				searchPhrase.append(" OR ");
			searchPhrase.append(words[i]);
		}
		CodedNodeSet nodes = lbSvc.getCodingSchemeConcepts(scheme, csvt);
		nodes.restrictToMatchingDesignations(
			searchPhrase.toString(), SearchDesignationOption.ALL, "StemmedLuceneQuery", null);
		SortOptionList sortCriteria =
			Constructors.createSortOptionList(new String[]{"matchToQuery"});
		PropertyType[] fetchTypes =
			new PropertyType[] {PropertyType.PRESENTATION};
		ResolvedConceptReferenceList matches =
			nodes.resolveToList(sortCriteria, null, fetchTypes, -1);
		if (matches.getResolvedConceptReferenceCount() > 0) {
			for (int i = 0; i < matches.getResolvedConceptReferenceCount(); i++) {
				ResolvedConceptReference ref = matches.getResolvedConceptReference(i);
				printText(ref, words, 1);
			}
		} else {
			Util.displayMessage("\tNo match found.");
		}
	}
protected void matchSubquery ( String s , EVSApplicationService lbSvc , String scheme , CodingSchemeVersionOrTag csvt ) throws LBException { Util . displayMessage ( "\n*** Subquery match (incorporates partial normalization/stemming)." ) ; StringBuffer searchPhrase = new StringBuffer ( ) ; String [ ] words = toWords ( s , true ) ; for ( int i = 0 ; i < words . length ; i ++ ) { if ( i > 0 ) searchPhrase . append ( " OR " ) ; searchPhrase . append ( words [ i ] ) ; } CodedNodeSet nodes = lbSvc . getCodingSchemeConcepts ( scheme , csvt ) ; nodes . restrictToMatchingDesignations ( searchPhrase . toString ( ) , SearchDesignationOption . ALL , "StemmedLuceneQuery" , null ) ; SortOptionList sortCriteria = Constructors . createSortOptionList ( new String [ ] { "matchToQuery" } ) ; PropertyType [ ] fetchTypes = new PropertyType [ ] { PropertyType . PRESENTATION } ; ResolvedConceptReferenceList matches = nodes . resolveToList ( sortCriteria , null , fetchTypes , - 1 ) ; if ( matches . getResolvedConceptReferenceCount ( ) > 0 ) { for ( int i = 0 ; i < matches . getResolvedConceptReferenceCount ( ) ; i ++ ) { ResolvedConceptReference ref = matches . getResolvedConceptReference ( i ) ; printText ( ref , words , 1 ) ; } } else { Util . displayMessage ( "\tNo match found." ) ; } }
Attempt to approximate compositional or sub-query match (e.g., "peptic ulcer"
 will match the two separate concepts for "peptic" and "ulcer", in case the
 ontology does not contain any concept matching the full text "peptic ulcer").
Attempt to approximate compositional or sub - query match ( e . g . " peptic ulcer " will match the two separate concepts for " peptic " and " ulcer " in case the ontology does not contain any concept matching the full text " peptic ulcer " ) .
// Similar to synonym match, only allow match on any single non-stop word
 // and only print presentations matching the query.
 //
 // On resolve, we sort by lucene score ('matchToQuery' sort algorithm).
 // Define the code set and add restrictions ...
 // Resolve and analyze the result ...
 // Found a match?  If so, print each associated presentation containing at least
 // one word from the query expression (exclude non-matching synonyms).
