Package com.yahoo.prelude.semantics.rule
Class ReferenceTermProduction
- java.lang.Object
-
- com.yahoo.prelude.semantics.rule.Production
-
- com.yahoo.prelude.semantics.rule.TermProduction
-
- com.yahoo.prelude.semantics.rule.ReferenceTermProduction
-
public class ReferenceTermProduction extends TermProduction
A term produced by a production rule which takes its actual term value from one or more terms matched in the condition- Author:
- bratseth
-
-
Field Summary
-
Fields inherited from class com.yahoo.prelude.semantics.rule.Production
replacing
-
-
Constructor Summary
Constructors Constructor Description ReferenceTermProduction(String reference, boolean produceAll)
Creates a new produced reference termReferenceTermProduction(String reference, TermType termType, boolean produceAll)
Creates a new produced reference termReferenceTermProduction(String label, String reference, boolean produceAll)
Creates a new produced reference termReferenceTermProduction(String label, String reference, TermType termType, boolean produceAll)
Creates a new produced reference term
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getReference()
Returns the label of the condition this should take its value from, never nullvoid
produce(RuleEvaluation e, int ignored)
Produces this at the current matchboolean
producesAll()
String
toInnerTermString()
-
Methods inherited from class com.yahoo.prelude.semantics.rule.TermProduction
getLabel, getLabelString, getTermType, insertMatch, setLabel, setTermType, toInnerString
-
Methods inherited from class com.yahoo.prelude.semantics.rule.Production
getPosition, getWeight, setPosition, setReplacing, setWeight, toString
-
-
-
-
Constructor Detail
-
ReferenceTermProduction
public ReferenceTermProduction(String reference, boolean produceAll)
Creates a new produced reference term- Parameters:
reference
- the label of the condition this should take it's value from
-
ReferenceTermProduction
public ReferenceTermProduction(String reference, TermType termType, boolean produceAll)
Creates a new produced reference term- Parameters:
reference
- the label of the condition this should take its value fromtermType
- the type of the term to produce
-
ReferenceTermProduction
public ReferenceTermProduction(String label, String reference, boolean produceAll)
Creates a new produced reference term- Parameters:
label
- the label of the produced termreference
- the label of the condition this should take its value from
-
ReferenceTermProduction
public ReferenceTermProduction(String label, String reference, TermType termType, boolean produceAll)
Creates a new produced reference term- Parameters:
label
- the label of the produced termreference
- the label of the condition this should take its value fromtermType
- the type of term to produce
-
-
Method Detail
-
getReference
public String getReference()
Returns the label of the condition this should take its value from, never null
-
producesAll
public boolean producesAll()
-
produce
public void produce(RuleEvaluation e, int ignored)
Description copied from class:Production
Produces this at the current match- Specified by:
produce
in classProduction
- Parameters:
e
- the evaluation context containing the current match and the queryignored
- the offset position at which to produce this. Offsets are used to produce multiple items at one position, inserted in the right order.
-
toInnerTermString
public String toInnerTermString()
- Specified by:
toInnerTermString
in classTermProduction
-
-