OpenNlp/src/main/java/stanford/related/extraction/OpenNLPPipeline.java
public Parse[] parseSentence(final String text, final Span[] tokens, final int n) {
		final Parse p = new Parse(text,
		// a new span covering the entire text
				new Span(0, text.length()),
				// the label for the top if an incomplete node
				AbstractBottomUpParser.INC_NODE,
				// the probability of this parse...uhhh...?
				1,
				// the token index of the head of this parse
				0);

		for (int idx = 0; idx < tokens.length; idx++) {
			final Span tok = tokens[idx];
			// flesh out the parse with token sub-parses
			p.insert(new Parse(text, tok, AbstractBottomUpParser.TOK_NODE, 0, idx));
		}
		synchronized (parser) {
			return parser.parse(p, n);
		}

	}
/**
	 * Create parse trees from a sentence
	 * @param text the sentence string
	 * @param tokens an array of spans with token positions
	 * @param n how many parse trees to return
	 * @return an array of probable parse trees
	 */
Create parse trees from a sentence
@param text the sentence string
@param tokens an array of spans with token positions
@param n how many parse trees to return
@return an array of probable parse trees
Create parse trees from a sentence @param text the sentence string @param tokens an array of spans with token positions @param n how many parse trees to return @return an array of probable parse trees
public Parse[] parseSentence(final String text, final Span[] tokens, final int n) {
		final Parse p = new Parse(text,
				new Span(0, text.length()),
				AbstractBottomUpParser.INC_NODE,
				1,
				0);
		for (int idx = 0; idx < tokens.length; idx++) {
			final Span tok = tokens[idx];
			p.insert(new Parse(text, tok, AbstractBottomUpParser.TOK_NODE, 0, idx));
		}
		synchronized (parser) {
			return parser.parse(p, n);
		}
	}
public Parse [ ] parseSentence ( final String text , final Span [ ] tokens , final int n ) { final Parse p = new Parse ( text , new Span ( 0 , text . length ( ) ) , AbstractBottomUpParser . INC_NODE , 1 , 0 ) ; for ( int idx = 0 ; idx < tokens . length ; idx ++ ) { final Span tok = tokens [ idx ] ; p . insert ( new Parse ( text , tok , AbstractBottomUpParser . TOK_NODE , 0 , idx ) ) ; } synchronized ( parser ) { return parser . parse ( p , n ) ; } }
Create parse trees from a sentence
 @param text the sentence string
 @param tokens an array of spans with token positions
 @param n how many parse trees to return
 @return an array of probable parse trees
Create parse trees from a sentence @param text the sentence string @param tokens an array of spans with token positions @param n how many parse trees to return @return an array of probable parse trees
// a new span covering the entire text // the label for the top if an incomplete node // the probability of this parse...uhhh...? // the token index of the head of this parse // flesh out the parse with token sub-parses