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
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
ConstructorDescriptionCreates a produced template term with no label and the default typeTermProduction
(TermType termType) Creates a produced template term with no labelTermProduction
(String label) Creates a produced template term with the default term typeTermProduction
(String label, TermType termType) -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()
Sets the label of this.protected String
Returns the type of term to produce, never null.protected void
insertMatch
(RuleEvaluation e, Match matched, List<Item> newItems, int offset) Inserts newItem at the position of this match TODO: Move to ruleevaluationvoid
Returns the label of this, or null if none (the default)void
setTermType
(TermType termType) Sets the term type to producefinal String
All instances of this produces a parseable string outputprotected abstract String
Methods inherited from class com.yahoo.prelude.semantics.rule.Production
getPosition, getWeight, produce, setPosition, setReplacing, setWeight, toString
-
Constructor Details
-
TermProduction
public TermProduction()Creates a produced template term with no label and the default type -
TermProduction
Creates a produced template term with the default term type -
TermProduction
Creates a produced template term with no label -
TermProduction
-
-
Method Details
-
getLabel
Sets the label of this. Set to null to use the default -
setLabel
Returns the label of this, or null if none (the default) -
getTermType
Returns the type of term to produce, never null. Default is DEFAULT -
setTermType
Sets the term type to produce -
insertMatch
Inserts newItem at the position of this match TODO: Move to ruleevaluation -
getLabelString
-
toInnerString
All instances of this produces a parseable string output- Specified by:
toInnerString
in classProduction
-
toInnerTermString
-