title: Parse sentence Stanford Parser by passing String not an array of strings
body: <p>Is it possible to parse a sentence using the Stanford Parser by passing a string and not an array of strings. This is the example they gave in their short tutorial (<a href="http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/parser/lexparser/package-summary.html" rel="nofollow">See Docs</a>) :</p>
  
  <p>Here's example:</p>
  
  <pre><code>    import java.util.*;
      import edu.stanford.nlp.ling.*;
      import edu.stanford.nlp.trees.*;
      import edu.stanford.nlp.parser.lexparser.LexicalizedParser;
  
      class ParserDemo {
        public static void main(String[] args) {
          LexicalizedParser lp = LexicalizedParser.loadModel("edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz");
          lp.setOptionFlags(new String[]{"-maxLength", "80", "-retainTmpSubcategories"});
  
          String[] sent = { "This", "is", "an", "easy", "sentence", "." }; // This is the sentence to be parsed
          List&lt;CoreLabel&gt; rawWords = Sentence.toCoreLabelList(sent);
          Tree parse = lp.apply(rawWords);
          parse.pennPrint();
          System.out.println();
  
          TreebankLanguagePack tlp = new PennTreebankLanguagePack();
          GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
          GrammaticalStructure gs = gsf.newGrammaticalStructure(parse);
          List&lt;TypedDependency&gt; tdl = gs.typedDependenciesCCprocessed();
          System.out.println(tdl);
          System.out.println();
  
        }
  
  }
  </code></pre>
  
  <p>I am trying to see if I can do this because I need to get sentences from a MySQL database and parse them directly as strings. I could tokezine the sentences and add the words, commas, and period to a String Array, However, to tokenize these sentences, I would have to use the Stanford Tokenizer , PTBTokenizer. The constructor of this tokenizer as listed here</p>
  
  <p>(<a href="http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/process/PTBTokenizer.html#PTBTokenizer%28java.io.Reader,%20edu.stanford.nlp.process.LexedTokenFactory,%20java.lang.String%29" rel="nofollow">See Docs</a>)</p>
  
  <p>requires a "java.io.FileReader" Object, but I am not reading a file from directory. So I am wondering if there is a way to either Parse the sentence directly by passing a string, or if I can solve my problem by tokenizing the sentence without requiring a "java.io.FileReader" Object.</p>