Class: Pione::PNML::ConstituentRule

Inherits:
PioneModel show all
Defined in:
lib/pione/pnml/pione-model.rb

Overview

ConstituentRule is a class represents PIONE's constituent rule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PioneModel

#indent

Constructor Details

#initialize(type, name) ⇒ ConstituentRule

Returns a new instance of ConstituentRule.

Parameters:

  • type (Symbol)

    rule type of either :input or :output

  • name (String)

    rule name



513
514
515
516
517
# File 'lib/pione/pnml/pione-model.rb', line 513

def initialize(type, name)
  @type = type
  @name = name
  @params = []
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



506
507
508
# File 'lib/pione/pnml/pione-model.rb', line 506

def name
  @name
end

#paramsObject (readonly)

Returns the value of attribute params.



507
508
509
# File 'lib/pione/pnml/pione-model.rb', line 507

def params
  @params
end

#typeObject (readonly)

Returns the value of attribute type.



505
506
507
# File 'lib/pione/pnml/pione-model.rb', line 505

def type
  @type
end

Instance Method Details

#as_declaration(option = {}) ⇒ String

Return a declaration of constituent rule.

Returns:

  • (String)

    a declaration string for PIONE's constituent rule



523
524
525
# File 'lib/pione/pnml/pione-model.rb', line 523

def as_declaration(option={})
  indent("rule %s" % textize_rule_expr, option)
end