TC Java
2011 Version

gov.nih.nlm.nls.tc.FilterApi
Class InputFilter

java.lang.Object
  extended by gov.nih.nlm.nls.tc.FilterApi.InputFilter

public class InputFilter
extends java.lang.Object

This class provides methods for input filter of TC tools

History:

Version:
V-2011
Author:
NLM Lexical Systems Group
See Also:
Design Document

Constructor Summary
InputFilter()
          Initiate the InputFilter object.
 
Method Summary
static java.util.Vector<java.lang.String> FilterUniqueWords(java.util.Vector<java.lang.String> inVec)
          Use unique filter to get Unique words and filter out duplicated words
 java.lang.String GetDebugMsg()
          Get debug message of text and MeSH inputFilter.
 java.util.Vector<java.lang.String> GetFinalMeshs()
          Get the final (legal) MeSHs.
 java.util.Vector<java.lang.String> GetFinalWords()
          Get the final words after all
static java.lang.String GetIdFromInputWithId(java.lang.String inStr)
          Get the id (unique Identifier) from inStr when the inStr in the format of: ID|string
 java.lang.String GetMeshDebugMsg()
          Get debug message of MeSH inputFilter.
static java.lang.String GetStringFromInputWithId(java.lang.String inStr)
          Get the string from inStr when the inStr in the format of: ID|string
 java.lang.String GetTextDebugMsg()
          Get debug message of text inputFilter.
 boolean MeshInputFilter(java.lang.String inMeshStr, Subheadings shs, java.sql.Connection conn)
          MeSH InputFilter, used in JDI for MeSH input.
static java.util.Vector<java.lang.String> TermToWords(java.lang.String term)
          Converts a string (term) into a collection of words.
 boolean TextInputFilter(java.lang.String inTextStr, InputFilterOption inputFilterOption, WordExtractionFilter wordExtractionFilter, LegalWords legalWordsObj)
          Text InputFilter, used in JDI and STI for text input.
 boolean TextInputFilter(java.lang.String inTextStr, InputFilterOption inputFilterOption, WordExtractionFilter wordExtractionFilter, LegalWords legalWordsObj, java.util.Vector<java.lang.String> forcedLegalWords)
          Text InputFilter with forces legal words, used in STI for WSD.
static java.lang.String WordsToTerm(java.util.Vector<java.lang.String> words)
          Converts a collection of words into a string (term).
static java.lang.String WordsToTerm(java.util.Vector<java.lang.String> words, java.lang.String fieldSep)
          Converts a collection of words into a string (term) with specified field separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputFilter

public InputFilter()
Initiate the InputFilter object.

Method Detail

GetIdFromInputWithId

public static java.lang.String GetIdFromInputWithId(java.lang.String inStr)
Get the id (unique Identifier) from inStr when the inStr in the format of: ID|string

Parameters:
inStr - the input string in format of ID|string
Returns:
the ID, unique identifier

GetStringFromInputWithId

public static java.lang.String GetStringFromInputWithId(java.lang.String inStr)
Get the string from inStr when the inStr in the format of: ID|string

Parameters:
inStr - the input string in format of ID|string
Returns:
the string, used as input for JDI, STI and STRI

GetFinalWords

public java.util.Vector<java.lang.String> GetFinalWords()
Get the final words after all

Returns:
the final words, which are used to calculate the JDI scores

GetFinalMeshs

public java.util.Vector<java.lang.String> GetFinalMeshs()
Get the final (legal) MeSHs.

Returns:
the final legal MeSHs, which are used to calculate the JDI scores

GetDebugMsg

public java.lang.String GetDebugMsg()
Get debug message of text and MeSH inputFilter.

Returns:
debug message of text and MeSH inputFilter

GetTextDebugMsg

public java.lang.String GetTextDebugMsg()
Get debug message of text inputFilter.

Returns:
debug message of text inputFilter

GetMeshDebugMsg

public java.lang.String GetMeshDebugMsg()
Get debug message of MeSH inputFilter.

Returns:
debug message of MeSH inputFilter

TextInputFilter

public boolean TextInputFilter(java.lang.String inTextStr,
                               InputFilterOption inputFilterOption,
                               WordExtractionFilter wordExtractionFilter,
                               LegalWords legalWordsObj)
Text InputFilter, used in JDI and STI for text input.

Parameters:
inTextStr - input text str to be processed
inputFilterOption - inputFilter options object
wordExtractionFilter - the word extractinfilter java object
legalWordsObj - the legal words java object

TextInputFilter

public boolean TextInputFilter(java.lang.String inTextStr,
                               InputFilterOption inputFilterOption,
                               WordExtractionFilter wordExtractionFilter,
                               LegalWords legalWordsObj,
                               java.util.Vector<java.lang.String> forcedLegalWords)
Text InputFilter with forces legal words, used in STI for WSD.

Parameters:
inTextStr - input text str to be processed
inputFilterOption - inputFilter options object
wordExtractionFilter - the word extractinfilter java object
legalWordsObj - the legal words java object
forcedLegalWords - forces legal words

MeshInputFilter

public boolean MeshInputFilter(java.lang.String inMeshStr,
                               Subheadings shs,
                               java.sql.Connection conn)
MeSH InputFilter, used in JDI for MeSH input.

Parameters:
inMeshStr - input MeSH str to be processed
shs - Subheadings java object
conn - database connection

TermToWords

public static java.util.Vector<java.lang.String> TermToWords(java.lang.String term)
Converts a string (term) into a collection of words.

Parameters:
term - the term to be converts (string)
Returns:
the converted words (strings)

WordsToTerm

public static java.lang.String WordsToTerm(java.util.Vector<java.lang.String> words)
Converts a collection of words into a string (term).

Parameters:
words - a collection of words
Returns:
the converted term (string)

WordsToTerm

public static java.lang.String WordsToTerm(java.util.Vector<java.lang.String> words,
                                           java.lang.String fieldSep)
Converts a collection of words into a string (term) with specified field separator.

Parameters:
words - a collection of words
fieldSep - field separator
Returns:
the converted term (string)

FilterUniqueWords

public static java.util.Vector<java.lang.String> FilterUniqueWords(java.util.Vector<java.lang.String> inVec)
Use unique filter to get Unique words and filter out duplicated words

Parameters:
inVec - a Vecotr of input words
Returns:
a Vector of unique words

TC Java
2011 Version

Submit a bug or feature

Copyright © 2011 National Library of Medicine