Class LiteralPhraseProduction


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

    • LiteralPhraseProduction

      public LiteralPhraseProduction()
      Creates a new produced literal phrase
    • LiteralPhraseProduction

      public LiteralPhraseProduction(String label)
      Creates a new produced literal phrase
      Parameters:
      label - the label of the produced term
  • Method Details

    • addTerm

      public void addTerm(String term)
      Adds a term to this phrase
    • getTerms

      public List<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 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