本文整理汇总了Java中org.neo4j.graphdb.traversal.Evaluator类的典型用法代码示例。如果您正苦于以下问题:Java Evaluator类的具体用法?Java Evaluator怎么用?Java Evaluator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Evaluator类属于org.neo4j.graphdb.traversal包,在下文中一共展示了Evaluator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPatternMatch
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
private Traverser getPatternMatch(Node startNode, final List<String> patterns, final List<NodeLabel> nodeLabels, final List<LinkLabel> linkLabels) {
TraversalDescription td = database.traversalDescription()
.depthFirst()
.evaluator( new Evaluator() {
public Evaluation evaluate( final org.neo4j.graphdb.Path path ) {
if ( path.length() == 0 ) {
return Evaluation.EXCLUDE_AND_CONTINUE;
}
boolean isToken = path.endNode().hasLabel(NodeLabel.WordToken);
boolean included = isToken && (path.length() == 1 || nodeHasAnnotation(path.endNode(), linkLabels.get(path.length() - 1), patterns.get(path.length() - 1)));
boolean continued = path.length() < patterns.size();
return Evaluation.of( included, continued );
}
} )
.relationships(LinkLabel.NEXT, Direction.OUTGOING)
.relationships(LinkLabel.HAS_TYPE, Direction.INCOMING)
.relationships(LinkLabel.HAS_LEMMA, Direction.INCOMING)
.relationships(LinkLabel.HAS_POS_TAG, Direction.INCOMING)
.relationships(LinkLabel.HAS_HEAD, Direction.INCOMING);
return td.traverse(startNode);
}
示例2: evaluate
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
public Evaluation evaluate( Path position )
{
boolean includes = true;
boolean continues = true;
for ( Evaluator evaluator : this.evaluators )
{
Evaluation bla = evaluator.evaluate( position );
if ( !bla.includes() )
{
includes = false;
}
if ( !bla.continues() )
{
continues = false;
}
if ( !continues && !includes )
{
return Evaluation.EXCLUDE_AND_PRUNE;
}
}
return Evaluation.of( includes, continues );
}
示例3: addBlaEvaluator
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
private Evaluator addBlaEvaluator( Evaluator evaluator )
{
if ( this.evaluator instanceof MultiEvaluator )
{
return ((MultiEvaluator) this.evaluator).add( evaluator );
}
else
{
if ( this.evaluator == Evaluators.all() )
{
return evaluator;
}
else
{
return new MultiEvaluator( new Evaluator[] { this.evaluator, evaluator } );
}
}
}
示例4: add
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
public MultiEvaluator add( Evaluator evaluator )
{
Evaluator[] newArray = new Evaluator[this.evaluators.length+1];
System.arraycopy( this.evaluators, 0, newArray, 0, this.evaluators.length );
newArray[newArray.length-1] = evaluator;
return new MultiEvaluator( newArray );
}
示例5: TraversalDescriptionImpl
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
private TraversalDescriptionImpl( Expander expander,
UniquenessFactory uniqueness, Object uniquenessParameter,
Evaluator evaluator, BranchOrderingPolicy branchSelector )
{
this.expander = expander;
this.uniqueness = uniqueness;
this.uniquenessParameter = uniquenessParameter;
this.evaluator = evaluator;
this.branchSelector = branchSelector;
}
示例6: TraversalPrinter
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
public TraversalPrinter( Evaluator innerEvaluator, String... propertyNames )
{
this.innerEvaluator = innerEvaluator;
this.propertyNames = asList( propertyNames );
}
示例7: MultiEvaluator
import org.neo4j.graphdb.traversal.Evaluator; //导入依赖的package包/类
MultiEvaluator( Evaluator... prunings )
{
this.evaluators = prunings;
}