Class LiteralTermProduction


public class LiteralTermProduction extends TermProduction
A literal term produced by a production rule
Author:
bratseth
  • Constructor Details

    • 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 from
      termType - the type of term to produce
    • LiteralTermProduction

      public LiteralTermProduction(String label, String literal, TermType termType)
      Creates a new produced literal term
      Parameters:
      label - the label of the produced term
      literal - this term word
      termType - the type of term to produce
  • Method Details

    • 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 class Production
      Parameters:
      e - the evaluation context containing the current match and the query
      offset - 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 class TermProduction