public class ScoreTerm
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
ScoreTerm.ScoredTerm |
Constructor and Description |
---|
ScoreTerm() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Program entry point.
|
protected void |
printReport(org.apache.commons.collections.BidiMap result)
Display results to the user.
|
protected ResolvedConceptReferencesIterator |
resolveConcepts(CodingSchemeSummary css,
java.lang.String query)
Resolves matching concepts for any word in the given term.
|
void |
run(java.lang.String term,
float minScore)
Runs the score algorithm for a specific term.
|
protected float |
score(java.util.SortedSet wordsToCompare,
java.util.SortedSet wordsToCompareAgainst)
Returns a score providing a relative comparison of the first set of words
against the second.
|
protected java.util.SortedSet |
toWords(java.lang.String s)
Return the words comprising the given string, in order ignoring
duplicates, common separators and punctuation.
|
public static void main(java.lang.String[] args)
args
- String[]public void run(java.lang.String term, float minScore) throws java.lang.Exception
term
- The text to evaluate.score
- Lower cutoff (percentage); a value less than or equal to 0
indicates no cutoff.java.lang.Exception
protected ResolvedConceptReferencesIterator resolveConcepts(CodingSchemeSummary css, java.lang.String query) throws LBException
css
- The code system to search.matchWords
- The term to match.LBException
protected float score(java.util.SortedSet wordsToCompare, java.util.SortedSet wordsToCompareAgainst)
Currently the score is evaluated as a simple percentage based on number of words in the first set that are also in the second (order independent). This could be enhanced to take order into account, etc.
wordsToCompare
- wordsToCompareAgainst
- protected void printReport(org.apache.commons.collections.BidiMap result)
result
- protected java.util.SortedSet toWords(java.lang.String s)
s
-