de.tudarmstadt.ukp.jwktl.parser.util
Class StringUtils

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.parser.util.StringUtils

public final class StringUtils
extends Object

Set of static string-processing methods used throughout the software.

Author:
Christian M. Meyer

Method Summary
static Set<Integer> compileIndexSet(String indexedStr)
          Parses a string representation of index numbers and returns a set of integers containing all numbers of the specified range.
static String removeReferences(String text)
          Removes all references or literature patterns from the given input text.
static String[] split(String text, char divider)
          Creates a new string array from the given string, in which each field corresponds to a token of the input text.
static String strip(String text, String characters)
          Removes the specified characters from the left and right of the specified text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

split

public static String[] split(String text,
                             char divider)
Creates a new string array from the given string, in which each field corresponds to a token of the input text. Tokens are separated from each other by the specified divider character. The method thus corresponds to its perl sibling. It may be used for processing tabular- or comme-separated files.


strip

public static String strip(String text,
                           String characters)
Removes the specified characters from the left and right of the specified text. The method thus corresponds to the trim function, but with arbitrary characters.


removeReferences

public static String removeReferences(String text)
Removes all references or literature patterns from the given input text.


compileIndexSet

public static Set<Integer> compileIndexSet(String indexedStr)
Parses a string representation of index numbers and returns a set of integers containing all numbers of the specified range. The method is capable of handling single numbers ("23" -> {23}), multiple comma-, or full-stop-separated numbers ("1,2. 4" -> {1,2,4}", and number ranges ("1-4" -> {1,2,3,4}).



Copyright © 2011-2013 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.