synesketch.emotion.util
Class ParsingUtility

java.lang.Object
  extended by synesketch.emotion.util.ParsingUtility

public class ParsingUtility
extends java.lang.Object

Utility class for some text parsing alghoritms

Version:
1.0
Author:
Uros Krcadinac email: uros@krcadinac.com

Constructor Summary
ParsingUtility()
           
 
Method Summary
static boolean containsFirst(java.lang.String container, java.lang.String containee)
          Returns true if the fist word begins with the second.
static java.util.ArrayList<java.lang.String> parseSentences(java.lang.String text)
          Pareses text into sentences.
static java.util.ArrayList<java.lang.String> parseWords(java.lang.String text)
          Pareses sentences into words.
static java.util.List<java.lang.String> splitWords(java.lang.String text, java.lang.String splitter)
          Splits words by a given String argument (' ' or '-', to name two examples).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsingUtility

public ParsingUtility()
Method Detail

parseSentences

public static java.util.ArrayList<java.lang.String> parseSentences(java.lang.String text)
Pareses text into sentences.

Parameters:
text - String which represents the text
Returns:
ArrayList of String instances representing the sentences

parseWords

public static java.util.ArrayList<java.lang.String> parseWords(java.lang.String text)
Pareses sentences into words.

Parameters:
text - String which represents the sentence
Returns:
ArrayList of String instances representing the words

splitWords

public static java.util.List<java.lang.String> splitWords(java.lang.String text,
                                                          java.lang.String splitter)
Splits words by a given String argument (' ' or '-', to name two examples).

Parameters:
text - String which represents the text
splitter - String which represents the splitting mark (' ' or '-', to name two examples)
Returns:
List of String instances representing the splited words

containsFirst

public static boolean containsFirst(java.lang.String container,
                                    java.lang.String containee)
Returns true if the fist word begins with the second.

Parameters:
container - String which represents the container word
containee - String which represents the containee word
Returns:
boolean, true if the fist word begins with the second