|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ir.utilities.MoreString
public class MoreString
A place to put some additional string functions
Constructor Summary | |
---|---|
MoreString()
|
Method Summary | |
---|---|
static int |
countPhrase(java.lang.String string,
java.lang.String substring)
Counts the number of times that a given substring appears in a string using matching as defined in startsWithPhrase |
static int |
countPhrase(java.lang.String string,
java.lang.String substring,
int fromIndex)
Counts the number of times that a given substring appears in a string using matching as defined in startsWithPhrase and starting in the string from fromIndex |
static java.lang.String |
fileExtension(java.lang.String fileName)
|
static java.lang.String |
fileToString(java.lang.String fileName)
Load the stopwords from file to the hashtable where they are indexed. |
static int |
indexOfIgnoreCase(java.lang.String string,
java.lang.String substring)
|
static int |
indexOfIgnoreCase(java.lang.String string,
java.lang.String substring,
int fromIndex)
|
static int |
indexOfPhrase(java.lang.String string,
java.lang.String substring)
Version of String method indexOf that treats all whitespace characters in substring as matching any "word boundary" and matches lowercase characters in the substring to either lower or uppercase in the string, but uppercase characters in the substring must match uppercase in the string |
static int |
indexOfPhrase(java.lang.String string,
java.lang.String substring,
int fromIndex)
Version of String method indexOf that treats all whitespace characters as equivalent and matches lowercase characters in the substring to either lower or uppercase in the string, but uppercase characters in the substring must match uppercase in the string |
static boolean |
isWordBoundary(char x)
Returns true iff character is in a specific set considered to mark a word boundary |
static void |
main(java.lang.String[] args)
|
static java.lang.String |
padTo(java.lang.String string,
int length)
Pad a string with blanks on the right to make it the specified length |
static java.lang.String |
padTo(java.lang.String string,
int length,
char ch)
Pad a string with a specific char on the right to make it the specified length |
static java.lang.String |
padToLeft(double x,
int length)
Convert a double to a string and pad with blanks on the left to make it the specified length |
static java.lang.String |
padToLeft(int x,
int length)
Convert an int to a string and pad with blanks on the left to make it the specified length |
static java.lang.String |
padToLeft(java.lang.String string,
int length)
Pad a string with blanks on the left to make it the specified length |
static java.lang.String |
padToLeft(java.lang.String string,
int length,
char ch)
Pad a string with a specific char on the left to make it the specified length |
static java.lang.String |
padWithZeros(double x,
int length)
|
static java.lang.String |
padWithZeros(int x,
int length)
|
static java.util.ArrayList<java.lang.String> |
segment(java.lang.String string,
char ch)
Segment a string into substrings by breaking at occurences of the given character and returning a list of segments |
static java.lang.String[] |
segmentToArray(java.lang.String string,
char ch)
Segment a string into substrings by breaking at occurrences of the given character and returning an array of all the segments, in order |
static boolean |
startsWithIgnoreCase(java.lang.String string,
java.lang.String substring)
|
static boolean |
startsWithIgnoreCase(java.lang.String string,
java.lang.String substring,
int fromIndex)
|
static boolean |
startsWithPhrase(java.lang.String string,
java.lang.String substring)
Version of String method startsWith that treats all whitespace characters in substring as matching any "word boundary" and matches lowercase characters in the substring to either lower or uppercase in the string, but uppercase characters in the substring must match uppercase in the string |
static boolean |
startsWithPhrase(java.lang.String string,
java.lang.String substring,
int fromIndex)
Version of String method startsWith that treats all whitespace characters in substring as matching any "word boundary" and matches lowercase characters in the substring to either lower or uppercase in the string, but uppercase characters in the substring must match uppercase in the string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MoreString()
Method Detail |
---|
public static java.lang.String padTo(java.lang.String string, int length, char ch)
public static java.lang.String padTo(java.lang.String string, int length)
public static java.lang.String padToLeft(java.lang.String string, int length, char ch)
public static java.lang.String padToLeft(java.lang.String string, int length)
public static java.lang.String padToLeft(double x, int length)
public static java.lang.String padToLeft(int x, int length)
public static java.lang.String padWithZeros(int x, int length)
public static java.lang.String padWithZeros(double x, int length)
public static java.util.ArrayList<java.lang.String> segment(java.lang.String string, char ch)
public static java.lang.String[] segmentToArray(java.lang.String string, char ch)
public static int indexOfIgnoreCase(java.lang.String string, java.lang.String substring, int fromIndex)
public static int indexOfIgnoreCase(java.lang.String string, java.lang.String substring)
public static boolean startsWithIgnoreCase(java.lang.String string, java.lang.String substring, int fromIndex)
public static boolean startsWithIgnoreCase(java.lang.String string, java.lang.String substring)
public static int indexOfPhrase(java.lang.String string, java.lang.String substring, int fromIndex)
public static int indexOfPhrase(java.lang.String string, java.lang.String substring)
public static boolean startsWithPhrase(java.lang.String string, java.lang.String substring, int fromIndex)
public static boolean startsWithPhrase(java.lang.String string, java.lang.String substring)
public static boolean isWordBoundary(char x)
public static int countPhrase(java.lang.String string, java.lang.String substring, int fromIndex)
public static int countPhrase(java.lang.String string, java.lang.String substring)
public static java.lang.String fileExtension(java.lang.String fileName)
public static java.lang.String fileToString(java.lang.String fileName)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |