Interface DependencyParser
public interface DependencyParser
The interface for dependency parsers, which assign every token of a sentence a syntactic
head and a relation label, forming a single-rooted tree over the sentence.
Dependency parsing complements the constituency Parser:
where a constituency parse groups tokens into nested phrases, a dependency parse links
each token directly to the token it modifies. The result is a DependencyTree
whose indices refer back to the input token array, so spans computed for those tokens
remain valid for the parse.
Thread safety is implementation specific.
- Since:
- 3.0.0
- See Also:
-
Method Summary
-
Method Details
-
parse
Parses a sentence into aDependencyTree.- Parameters:
tokens- The input tokens. Must not benull, must contain at least one token, and must not containnullentries.tags- The part-of-speech tags aligned withtokens. Must not benull, must have the same length astokens, and must not containnullentries.- Returns:
- A
DependencyTreeover the given tokens. Nevernull. - Throws:
IllegalArgumentException- Thrown iftokensortagsisnull, empty, of mismatched length, or contains anullentry.
-