Package com.yahoo.prelude.semantics.rule
Class LiteralPhraseProduction
- java.lang.Object
-
- com.yahoo.prelude.semantics.rule.Production
-
- com.yahoo.prelude.semantics.rule.TermProduction
-
- com.yahoo.prelude.semantics.rule.LiteralPhraseProduction
-
public class LiteralPhraseProduction extends TermProduction
A literal phrase 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 LiteralPhraseProduction()
Creates a new produced literal phraseLiteralPhraseProduction(java.lang.String label)
Creates a new produced literal phrase
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTerm(java.lang.String term)
Adds a term to this phrasejava.util.List<java.lang.String>
getTerms()
Returns a read only view of the terms produced by this, never nullvoid
produce(RuleEvaluation e, int offset)
Produces this at the current matchjava.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
-
-
-
-
Method Detail
-
addTerm
public void addTerm(java.lang.String term)
Adds a term to this phrase
-
getTerms
public java.util.List<java.lang.String> getTerms()
Returns a read only view of the terms produced by this, 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 java.lang.String toInnerTermString()
- Specified by:
toInnerTermString
in classTermProduction
-
-