Class: TreeHaver::NormalizedTreeNode

Inherits:
Struct
  • Object
show all
Defined in:
lib/tree_haver/contracts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#anonymousObject

Returns the value of attribute anonymous

Returns:

  • (Object)

    the current value of anonymous



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def anonymous
  @anonymous
end

#backend_kindObject

Returns the value of attribute backend_kind

Returns:

  • (Object)

    the current value of backend_kind



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def backend_kind
  @backend_kind
end

#backend_rolesObject

Returns the value of attribute backend_roles

Returns:

  • (Object)

    the current value of backend_roles



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def backend_roles
  @backend_roles
end

#child_idsObject

Returns the value of attribute child_ids

Returns:

  • (Object)

    the current value of child_ids



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def child_ids
  @child_ids
end

#field_nameObject

Returns the value of attribute field_name

Returns:

  • (Object)

    the current value of field_name



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def field_name
  @field_name
end

#has_source_textObject

Returns the value of attribute has_source_text

Returns:

  • (Object)

    the current value of has_source_text



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def has_source_text
  @has_source_text
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def id
  @id
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def kind
  @kind
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def 
  @metadata
end

#namedObject

Returns the value of attribute named

Returns:

  • (Object)

    the current value of named



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def named
  @named
end

#parent_idObject

Returns the value of attribute parent_id

Returns:

  • (Object)

    the current value of parent_id



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def parent_id
  @parent_id
end

#roleObject

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def role
  @role
end

#semantic_rolesObject

Returns the value of attribute semantic_roles

Returns:

  • (Object)

    the current value of semantic_roles



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def semantic_roles
  @semantic_roles
end

#source_fragmentObject

Returns the value of attribute source_fragment

Returns:

  • (Object)

    the current value of source_fragment



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def source_fragment
  @source_fragment
end

#spanObject

Returns the value of attribute span

Returns:

  • (Object)

    the current value of span



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def span
  @span
end

#unsupported_featuresObject

Returns the value of attribute unsupported_features

Returns:

  • (Object)

    the current value of unsupported_features



539
540
541
# File 'lib/tree_haver/contracts.rb', line 539

def unsupported_features
  @unsupported_features
end

Instance Method Details

#to_hObject



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/tree_haver/contracts.rb', line 558

def to_h
  {
    id: id,
    kind: kind,
    role: role,
    parent_id: parent_id,
    child_ids: child_ids,
    span: span.to_h,
    field_name: field_name,
    named: named,
    anonymous: anonymous,
    has_source_text: has_source_text,
    source_fragment: source_fragment,
    backend_kind: backend_kind,
    semantic_roles: semantic_roles || [],
    backend_roles: backend_roles || [],
    unsupported_features: unsupported_features || [],
    metadata:  || {}
  }
end