/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package at.illecker.storm.examples.util.unsupervised;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Tokenizer {
  private static final Logger LOG = LoggerFactory.getLogger(Tokenizer.class);

  public static List<String> tokenize(String text) {
    List<String> tokens = new ArrayList<String>();
    // split at one ore more blanks
    String[] inputTokens = text.split("\\s+");
    for (String inputToken : inputTokens) {
      // LOG.info("inputToken : '" + inputToken + "'");
      tokens.add(inputToken);
    }
    return tokens;
  }

  public static void main(String[] args) {
    Tokenizer
        .tokenize("Gas by my house hit $3.39 !!!! I'm going to Chapel Hill on Sat . :)");
  }
}

@@ -851,16 +851,45 @@
 vised;%0A%0A
+import java.io.StringReader;%0A
 import j
@@ -943,72 +943,172 @@
 ort 
-org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Apublic class 
+edu.stanford.nlp.ling.HasWord;%0Aimport edu.stanford.nlp.ling.Word;%0Aimport edu.stanford.nlp.process.PTBTokenizer.PTBTokenizerFactory;%0Aimport edu.stanford.nlp.process.
 Toke
@@ -1116,71 +1116,83 @@
 izer
- %7B%0A  private static final Logger LOG = LoggerFactory.getLogger(
+Factory;%0Aimport edu.stanford.nlp.tagger.maxent.MaxentTagger;%0A%0Apublic class 
 Toke
@@ -1200,16 +1200,10 @@
 izer
-.class);
+ %7B
 %0A%0A  
@@ -1435,64 +1435,8 @@
 ) %7B%0A
-      // LOG.info(%22inputToken : '%22 + inputToken + %22'%22);%0A
     
@@ -1511,138 +1511,602 @@
 tic 
-void main(String%5B%5D args) %7B%0A    Tokenizer%0A        .tokenize(%22Gas by my house hit $3.39 !!!! I'm going to Chapel Hill on Sat . :)%22);
+List%3CList%3CHasWord%3E%3E tokenizeSentences(String text) %7B%0A    TokenizerFactory%3CWord%3E tokenizer = PTBTokenizerFactory%0A        .newTokenizerFactory();%0A    tokenizer.setOptions(%22ptb3Escaping=false%22);%0A%0A    return MaxentTagger.tokenizeText(new StringReader(text), tokenizer);%0A  %7D%0A%0A  public static void main(String%5B%5D args) %7B%0A    String text = %22Gas by my house hit $3.39 !!!! I'm going to Chapel Hill on Sat . :)%22;%0A    System.out.println(%22text: '%22 + text + %22'%22);%0A    List%3CString%3E tokens = Tokenizer.tokenize(text);%0A    for (String token : tokens) %7B%0A      System.out.println(%22token: '%22 + token + %22'%22);%0A    %7D
 %0A  %7D

Update Tokenizer