|
TC Java 2011 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nih.nlm.nls.tc.FilterApi.WordExtractionFilter
public class WordExtractionFilter
This class is to extract word from input strings. In our application. it gets the string from TI and AB in MEDLINE. The filtered string filter out follows:
History:
Constructor Summary | |
---|---|
WordExtractionFilter(Contractions contractions)
Create a word extraction filter object by specifying contractions Java object. |
|
WordExtractionFilter(java.lang.String contractionFile)
Create a word extraction filter object by specifying contractions file. |
|
WordExtractionFilter(java.lang.String contractionFile,
boolean verbose)
Create a word extraction filter object by specifying contractions file and verbose flag. |
Method Summary | |
---|---|
java.util.Vector<java.lang.String> |
ExpandContraction(java.util.Vector<java.lang.String> inWords)
Expand contraction to full name |
java.lang.String |
GetFilteredStr(java.lang.String inStr)
Get filtered string of the input string. |
static void |
main(java.lang.String[] args)
|
static java.lang.String |
RemoveExactEndStr(java.lang.String inStr,
java.util.Vector<java.lang.String> exactEndStrs)
remove end string if it is exact match. |
static java.lang.String |
RemoveMatchEndStr(java.lang.String inStr,
java.lang.String headMatchStr,
java.lang.String tailMatchStr)
Remove match head and tail string at the end, such as remove .....[headMatchStr ... |
static java.lang.String |
RemoveMatchEndStr(java.lang.String inStr,
java.util.Vector<java.lang.String> matchEndStrs,
boolean caseSensitiveFlag)
remove match head string at the end, such as remove .....[headMatchStr ...] |
static java.lang.String |
RemoveMatchEndStr(java.lang.String inStr,
java.util.Vector<java.lang.String> headMatchStrs,
java.util.Vector<java.lang.String> tailMatchStrs,
java.util.Vector<java.lang.String> headExceptionStrs)
Remove match head and tail string at the end with head exception string, such as remove .....[headMatchStr ... |
static java.lang.String |
RemoveMatchStr(java.lang.String inStr,
java.util.Vector<java.lang.String> headMatchStrs,
java.util.Vector<java.lang.String> tailMatchStrs)
Remove match head and tail string at the end, such as remove .....[headMatchStr ... |
static java.util.Vector<java.lang.String> |
RemoveNonAlphaNumCharAtBeginEnd(java.util.Vector<java.lang.String> inWords)
Remove non-alpha-numeric characters at the beginning or end of the string. |
static java.util.Vector<java.lang.String> |
RemoveNonAlphaNumCharAtBeginsEnds(java.util.Vector<java.lang.String> inWords)
Remove non-alpha-numeric characters at the beginning or end of the string recursively. |
static java.lang.String |
ReplacePuntuationWithSpace(java.lang.String inStr)
Replaces punctuation with space |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WordExtractionFilter(Contractions contractions)
contractions
- contractions Java objectpublic WordExtractionFilter(java.lang.String contractionFile)
contractionFile
- file name of contractions (contractions.txt)public WordExtractionFilter(java.lang.String contractionFile, boolean verbose)
contractionFile
- file name of contractions (contractions.txt)verbose
- flag of verbose on reading input fileMethod Detail |
---|
public java.lang.String GetFilteredStr(java.lang.String inStr)
inStr
- the string to be filtered
public static java.lang.String ReplacePuntuationWithSpace(java.lang.String inStr)
inStr
- the string to be processed
public java.util.Vector<java.lang.String> ExpandContraction(java.util.Vector<java.lang.String> inWords)
inWords
- a collection of Strings to be processed
public static java.util.Vector<java.lang.String> RemoveNonAlphaNumCharAtBeginEnd(java.util.Vector<java.lang.String> inWords)
inWords
- a collection of Strings to be processed
public static java.util.Vector<java.lang.String> RemoveNonAlphaNumCharAtBeginsEnds(java.util.Vector<java.lang.String> inWords)
inWords
- a collection of Strings to be processed
public static java.lang.String RemoveExactEndStr(java.lang.String inStr, java.util.Vector<java.lang.String> exactEndStrs)
inStr
- the string to be processedexactEndStrs
- a coolectin of pattern strings for exact match
public static java.lang.String RemoveMatchEndStr(java.lang.String inStr, java.util.Vector<java.lang.String> matchEndStrs, boolean caseSensitiveFlag)
inStr
- the string to be processedmatchEndStrs
- a collection of patterns string for matchcaseSensitiveFlag
- a boolean flag for case sensitive match
public static java.lang.String RemoveMatchEndStr(java.lang.String inStr, java.lang.String headMatchStr, java.lang.String tailMatchStr)
inStr
- the string to be processedheadMatchStr
- head match patterntailMatchStr
- tail match pattern
public static java.lang.String RemoveMatchStr(java.lang.String inStr, java.util.Vector<java.lang.String> headMatchStrs, java.util.Vector<java.lang.String> tailMatchStrs)
inStr
- the string to be processedheadMatchStrs
- a collection of head match patterntailMatchStrs
- a collection of tail match pattern
public static java.lang.String RemoveMatchEndStr(java.lang.String inStr, java.util.Vector<java.lang.String> headMatchStrs, java.util.Vector<java.lang.String> tailMatchStrs, java.util.Vector<java.lang.String> headExceptionStrs)
inStr
- the string to be processedheadMatchStrs
- a collection of head match patterntailMatchStrs
- a collection of tail match patternheadExceptionStrs
- a collection of head match exceptions
public static void main(java.lang.String[] args)
|
TC Java 2011 Version |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |