Package de.monochromata.anaphors.ast
Class ASTBasedAnaphorResolution<N,E,T,B,TB extends B,S,I,QI,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>>
java.lang.Object
de.monochromata.anaphors.ast.ASTBasedAnaphorResolution<N,E,T,B,TB,S,I,QI,R,A>
- Type Parameters:
N- The node type in the ASTE- The expression typeT- The type typeB- The binding typeTB- The type binding typeS- The scope type (optional)I- The type used to represent identifiersQI- The type used to represent qualified identifiersR- The sub-type of related expression to useA- The sub-type of AST-based anaphora to use
public class ASTBasedAnaphorResolution<N,E,T,B,TB extends B,S,I,QI,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>> extends Object
A generic interface to anaphora resolution. Note that invocations of the
interface need to be aware of a specific AST implementation to correctly
invoke the interface.
-
Constructor Summary
Constructors Modifier Constructor Description protectedASTBasedAnaphorResolution()Used in contract testing.ASTBasedAnaphorResolution(List<RelatedExpressionStrategy<N,T,B,TB,S,QI,R>> relatedExpressionStrategies, List<AnaphorResolutionStrategy<N,E,T,B,TB,S,I,QI,R,A>> resolutionStrategies, List<ReferentializationStrategy<E,TB,S,I,QI>> referentializationStrategies, Supplier<RelatedExpressionsCollector<N,E,T,B,TB,S,QI,R>> relatedExpressionsCollectorSupplier) -
Method Summary
Modifier and Type Method Description RgetRelatedExpression(N node)List<A>resolveAnaphor(String anaphor, E definiteExpression, S scope)Perform anaphora resolution on the AST implementation configured via the service provider interfaces.List<A>resolveAnaphor(List<R> potentialRelatedExpressions, String anaphor, E definiteExpression, S scope)List<A>resolveAnaphor(R potentialRelatedExpression, String anaphor, E definiteExpression, S scope)protected List<A>unifyCoReferentialReferents(List<A> potentialAnaphoraRelations)protected List<R>unifyCoReferentialRelatedExpressions(List<R> potentialRelatedExpressions)protected static <T> List<T>unifyListElements(List<T> elements, BiPredicate<T,T> check)protected List<ReferentializationStrategy<E,TB,S,I,QI>>validate(List<ReferentializationStrategy<E,TB,S,I,QI>> referentializationStrategies)
-
Constructor Details
-
ASTBasedAnaphorResolution
protected ASTBasedAnaphorResolution()Used in contract testing. -
ASTBasedAnaphorResolution
public ASTBasedAnaphorResolution(List<RelatedExpressionStrategy<N,T,B,TB,S,QI,R>> relatedExpressionStrategies, List<AnaphorResolutionStrategy<N,E,T,B,TB,S,I,QI,R,A>> resolutionStrategies, List<ReferentializationStrategy<E,TB,S,I,QI>> referentializationStrategies, Supplier<RelatedExpressionsCollector<N,E,T,B,TB,S,QI,R>> relatedExpressionsCollectorSupplier)
-
-
Method Details
-
validate
-
resolveAnaphor
Perform anaphora resolution on the AST implementation configured via the service provider interfaces.- Parameters:
anaphor- The anaphor that is to be (re-)resolved.definiteExpression- The expression that may function as anaphor in the anaphora relation to be generated by this method. If the anaphora relation is to be re-resolved, this can be a non-trivial expression. If the anaphora relation is to be resolved for the first time, this is typically a simple name and might as well be called a definite expression at this point.scope- May be null if not required by the AST implementation configured via the service provider interfaces.- Returns:
- A list of anaphors that the given definite expression can function as. The list is empty is the anaphor could not be resolved and will contain more than one element if the anaphor is ambiguous.
-
resolveAnaphor
-
resolveAnaphor
-
getRelatedExpression
- Returns:
- a potential
RelatedExpressionrepresenting the given node, or null, if the node cannot function as related expression.
-
unifyCoReferentialRelatedExpressions
-
unifyCoReferentialReferents
-
unifyListElements
-