Package com.yahoo.prelude.semantics.rule
Class TermProduction
- java.lang.Object
-
- com.yahoo.prelude.semantics.rule.Production
-
- com.yahoo.prelude.semantics.rule.TermProduction
-
- Direct Known Subclasses:
LiteralPhraseProduction
,LiteralTermProduction
,ReferenceTermProduction
public abstract class TermProduction extends Production
A new 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 TermProduction()
Creates a produced template term with no label and the default typeTermProduction(TermType termType)
Creates a produced template term with no labelTermProduction(java.lang.String label)
Creates a produced template term with the default term typeTermProduction(java.lang.String label, TermType termType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLabel()
Sets the label of this.protected java.lang.String
getLabelString()
TermType
getTermType()
Returns the type of term to produce, never null.protected void
insertMatch(RuleEvaluation e, Match matched, Item newItem, int offset)
Inserts newItem at the position of this match TODO: Move to ruleevaluationvoid
setLabel(java.lang.String label)
Returns the label of this, or null if none (the default)void
setTermType(TermType termType)
Sets the term type to producejava.lang.String
toInnerString()
All instances of this produces a parseable string outputprotected abstract java.lang.String
toInnerTermString()
-
Methods inherited from class com.yahoo.prelude.semantics.rule.Production
getPosition, getWeight, produce, setPosition, setReplacing, setWeight, toString
-
-
-
-
Constructor Detail
-
TermProduction
public TermProduction()
Creates a produced template term with no label and the default type
-
TermProduction
public TermProduction(java.lang.String label)
Creates a produced template term with the default term type
-
TermProduction
public TermProduction(TermType termType)
Creates a produced template term with no label
-
TermProduction
public TermProduction(java.lang.String label, TermType termType)
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Sets the label of this. Set to null to use the default
-
setLabel
public void setLabel(java.lang.String label)
Returns the label of this, or null if none (the default)
-
getTermType
public TermType getTermType()
Returns the type of term to produce, never null. Default is DEFAULT
-
setTermType
public void setTermType(TermType termType)
Sets the term type to produce
-
insertMatch
protected void insertMatch(RuleEvaluation e, Match matched, Item newItem, int offset)
Inserts newItem at the position of this match TODO: Move to ruleevaluation
-
getLabelString
protected java.lang.String getLabelString()
-
toInnerString
public final java.lang.String toInnerString()
All instances of this produces a parseable string output- Specified by:
toInnerString
in classProduction
-
toInnerTermString
protected abstract java.lang.String toInnerTermString()
-
-