public final class StringUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<Integer> |
exactStringFinder(String pattern,
String sentence)
Finds a pattern (typically a named entity string) in a sentence string.
|
static List<Integer> |
exactTokenFinder(String pattern,
String[] tokens)
Finds a pattern (typically a named entity string) in a tokenized sentence.
|
static List<Integer> |
exactTokenFinderIgnoreCase(String pattern,
String[] tokens)
Finds a pattern (typically a named entity string) in a tokenized sentence.
|
static List<File> |
getFilesInDir(File inputPath)
Recursively get every file in a directory and add them to a list.
|
static String |
getStringFromSpan(opennlp.tools.util.Span reducedSpan,
String[] tokens)
It takes a NE span indexes and the tokens in a sentence and produces the
string to which the NE span corresponds to.
|
static String |
getStringFromTokens(String[] tokens)
Gets the String joined by a space of an array of tokens.
|
public static List<Integer> exactTokenFinderIgnoreCase(String pattern, String[] tokens)
Span indexes of the named entity found, if any.pattern - a string to findtokens - an array of tokenspublic static List<Integer> exactTokenFinder(String pattern, String[] tokens)
Span indexes of the named entity found, if anypattern - a string to findtokens - an array of tokenspublic static List<Integer> exactStringFinder(String pattern, String sentence)
pattern - the pattern to be searchedsentence - the sentencepublic static String getStringFromSpan(opennlp.tools.util.Span reducedSpan, String[] tokens)
SpanreducedSpan - a Spantokens - an array of tokenspublic static String getStringFromTokens(String[] tokens)
tokens - an array of tokens representing a tokenized sentenceCopyright © 2015 IXA pipes. All rights reserved.