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
  • Constructor Details

    • TermProduction

      public TermProduction()
      Creates a produced template term with no label and the default type
    • TermProduction

      public TermProduction(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(String label, TermType termType)
  • Method Details

    • getLabel

      public String getLabel()
      Sets the label of this. Set to null to use the default
    • setLabel

      public void setLabel(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, List<Item> newItems, int offset)
      Inserts newItems at the position of this match TODO: Move to ruleevaluation
    • getLabelString

      protected String getLabelString()
    • toInnerString

      public final String toInnerString()
      All instances of this produces a parseable string output
      Specified by:
      toInnerString in class Production
    • toInnerTermString

      protected abstract String toInnerTermString()