Package com.yahoo.prelude.semantics.rule
Class Production
java.lang.Object
com.yahoo.prelude.semantics.rule.Production
- Direct Known Subclasses:
NamespaceProduction
,TermProduction
A new term produced by a production rule
- Author:
- bratseth
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
True to add, false to replace, default true -
Constructor Summary
ConstructorDescriptionCreates a produced template term with no label and the default type -
Method Summary
Modifier and TypeMethodDescriptionint
int
Returns the weight of this production as a percentage (default is 100)abstract void
produce
(RuleEvaluation e, int offset) Produces this at the current matchvoid
setPosition
(int position) void
setReplacing
(boolean replacing) True to replace, false to add, if this production can do both.void
setWeight
(int weight) Sets the weight of this production as a percentage (default is 100)protected abstract String
All instances of this produces a parseable string outputfinal String
toString()
All instances of this produces a parseable string output
-
Field Details
-
replacing
protected boolean replacingTrue to add, false to replace, default true
-
-
Constructor Details
-
Production
public Production()Creates a produced template term with no label and the default type
-
-
Method Details
-
setReplacing
public void setReplacing(boolean replacing) True to replace, false to add, if this production can do both. Default true. -
getPosition
public int getPosition() -
setPosition
public void setPosition(int position) -
setWeight
public void setWeight(int weight) Sets the weight of this production as a percentage (default is 100) -
getWeight
public int getWeight()Returns the weight of this production as a percentage (default is 100) -
produce
Produces this at the current match- Parameters:
e
- the evaluation context containing the current match and the queryoffset
- the offset position at which to produce this. Offsets are used to produce multiple items at one position, inserted in the right order.
-
toString
All instances of this produces a parseable string output -
toInnerString
All instances of this produces a parseable string output
-