@@ -0,0 +1,1981 @@
+import java.util.Collection;%0Aimport java.util.*;%0Aimport java.io.StringReader;%0Aimport java.io.IOException;%0Aimport java.lang.Exception;%0A%0Aimport edu.stanford.nlp.process.Tokenizer;%0Aimport edu.stanford.nlp.process.TokenizerFactory;%0Aimport edu.stanford.nlp.process.CoreLabelTokenFactory;%0Aimport edu.stanford.nlp.process.DocumentPreprocessor;%0Aimport edu.stanford.nlp.process.PTBTokenizer;%0Aimport edu.stanford.nlp.ling.CoreLabel;%0Aimport edu.stanford.nlp.ling.HasWord;%0Aimport edu.stanford.nlp.ling.Sentence;%0Aimport edu.stanford.nlp.trees.*;%0Aimport edu.stanford.nlp.parser.lexparser.LexicalizedParser;%0A%0Aclass APIWrapper %7B%0A%09%0A%09private static String parserModel;%0A%09private static String filename;%0A%09private static Tree parse;%0A%0A%09public static void usage() %7B%0A%09%09//TODO- complete the usage %0A%09%09System.out.println( %22Usage: java APIWrapper %3Ctext_file%3E%22);%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09parserModel = %22edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz%22;%0A%09%09if (args.length%3C1) %7B%0A%09%09%09usage();%0A%09%09%09return;%0A%09%09%7D%0A%09%09else %0A%09%09%09filename = args%5B0%5D;%0A%0A%09%09LexicalizedParser lp = LexicalizedParser.loadModel(parserModel);%0A%09%09TreebankLanguagePack tlp = lp.treebankLanguagePack();%0A%09%09GrammaticalStructureFactory gsf = null;%0A%0A%09%09if (tlp.supportsGrammaticalStructures()) %7B%0A      %09%09gsf = tlp.grammaticalStructureFactory();%0A    %09%7D%0A    %09for (List%3CHasWord%3E sentence : new DocumentPreprocessor(filename)) %7B%0A    %09%09//System.out.println(sentence);%0A      %09%09try %7B%0A      %09%09%09parse = lp.apply(sentence);%0A      %09%09%09//parse.pennPrint();%0A      %09%09%09//System.out.println();%0A      %09%09%09if (gsf != null) %7B%0A        %09%09%09GrammaticalStructure gs = gsf.newGrammaticalStructure(parse);%0A        %09%09%09Collection%3CTypedDependency%3E tdl = gs.typedDependencies();//CCprocessed();%0A        %09%09%09for (TypedDependency el:tdl) %7B%0A        %09%09%09%09System.out.println(el.toString());%0A        %09%09%09%7D%0A       %09%09%09%09//System.out.println(tdl);%0A        %09%09%09System.out.println();%0A        %09%09%7D%0A        %09%7D catch (Exception e) %7B%0A        %09%09%09e.printStackTrace();%0A        %09%7D%0A%09%09%7D%0A%09%7D%0A%7D

Add APIWrapper.java