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 it's 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(java.lang.String reference)
Creates a new produced reference termReferenceTermProduction(java.lang.String reference, TermType termType)
Creates a new produced reference termReferenceTermProduction(java.lang.String label, java.lang.String reference)
Creates a new produced reference termReferenceTermProduction(java.lang.String label, java.lang.String reference, TermType termType)
Creates a new produced reference term
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getReference()
Returns the label of the condition this should take its value from, never nullvoid
produce(RuleEvaluation e, int offset)
Produces this at the current matchvoid
replaceMatches(RuleEvaluation e, ReferencedMatches referencedMatches)
void
setReference(java.lang.String reference)
The label of the condition this should take its value from, never nulljava.lang.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(java.lang.String reference)
Creates a new produced reference term- Parameters:
reference
- the label of the condition this should take it's value from
-
ReferenceTermProduction
public ReferenceTermProduction(java.lang.String reference, TermType termType)
Creates a new produced reference term- Parameters:
reference
- the label of the condition this should take it's value fromtermType
- the type of the term to produce
-
ReferenceTermProduction
public ReferenceTermProduction(java.lang.String label, java.lang.String reference)
Creates a new produced reference term- Parameters:
label
- the label of the produced termreference
- the label of the condition this should take it's value from
-
ReferenceTermProduction
public ReferenceTermProduction(java.lang.String label, java.lang.String reference, TermType termType)
Creates a new produced reference term- Parameters:
label
- the label of the produced termreference
- the label of the condition this should take it's value fromtermType
- the type of term to produce
-
-
Method Detail
-
setReference
public void setReference(java.lang.String reference)
The label of the condition this should take its value from, never null
-
getReference
public java.lang.String getReference()
Returns the label of the condition this should take its value from, never null
-
produce
public void produce(RuleEvaluation e, int offset)
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 queryoffset
- the offset position at which to produce this. Offsets are used to produce multiple items at one position, inserted in the right order.
-
replaceMatches
public void replaceMatches(RuleEvaluation e, ReferencedMatches referencedMatches)
-
toInnerTermString
public java.lang.String toInnerTermString()
- Specified by:
toInnerTermString
in classTermProduction
-
-