Package com.yahoo.prelude.semantics.rule
Class LiteralTermProduction
- java.lang.Object
-
- com.yahoo.prelude.semantics.rule.Production
-
- com.yahoo.prelude.semantics.rule.TermProduction
-
- com.yahoo.prelude.semantics.rule.LiteralTermProduction
-
public class LiteralTermProduction extends TermProduction
A literal term produced by a production rule- Author:
- bratseth
-
-
Field Summary
-
Fields inherited from class com.yahoo.prelude.semantics.rule.Production
replacing
-
-
Constructor Summary
Constructors Constructor Description LiteralTermProduction(String literal)
Creates a new produced literal termLiteralTermProduction(String literal, TermType termType)
Creates a new produced literal termLiteralTermProduction(String label, String literal, TermType termType)
Creates a new produced literal term
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLiteral()
Returns the term word produced, never nullvoid
produce(RuleEvaluation e, int offset)
Produces this at the current matchvoid
setLiteral(String literal)
The literal term value, never nullString
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
-
LiteralTermProduction
public LiteralTermProduction(String literal)
Creates a new produced literal term- Parameters:
literal
- the label of the condition this should take it's value from
-
LiteralTermProduction
public LiteralTermProduction(String literal, TermType termType)
Creates a new produced literal term- Parameters:
literal
- the label of the condition this should take it's value fromtermType
- the type of term to produce
-
-
Method Detail
-
setLiteral
public void setLiteral(String literal)
The literal term value, never null
-
getLiteral
public String getLiteral()
Returns the term word produced, 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.
-
toInnerTermString
public String toInnerTermString()
- Specified by:
toInnerTermString
in classTermProduction
-
-