Nasty.AST.Semantic.Role (Nasty v0.3.0)

View Source

Semantic role assigned to a phrase in relation to a predicate.

Represents the semantic function of a participant or circumstance in a predicate-argument structure (e.g., Agent, Patient, Location).

Based on PropBank and VerbNet role inventories.

Summary

Types

Semantic role types.

t()

Functions

Checks if role is an adjunct (not a core argument).

Checks if role is a core argument (not an adjunct).

Creates a new semantic role.

Types

role_type()

@type role_type() ::
  :agent
  | :patient
  | :theme
  | :experiencer
  | :recipient
  | :beneficiary
  | :source
  | :goal
  | :location
  | :time
  | :manner
  | :instrument
  | :purpose
  | :cause
  | :comitative

Semantic role types.

Core roles (arguments)

  • :agent - Volitional causer/actor (typically subject of transitive)
  • :patient - Entity acted upon (typically direct object)
  • :theme - Entity undergoing action or in a state
  • :experiencer - Entity experiencing a mental/perceptual state
  • :recipient - Entity receiving something
  • :beneficiary - Entity benefiting from action
  • :source - Starting point of motion/transfer
  • :goal - Endpoint of motion/transfer

Adjunct roles (modifiers)

  • :location - Place where action occurs
  • :time - Time when action occurs
  • :manner - How action is performed
  • :instrument - Tool/means used
  • :purpose - Reason/goal for action
  • :cause - Reason/cause of action
  • :comitative - Accompanying entity ("with X")

t()

@type t() :: %Nasty.AST.Semantic.Role{
  phrase: Nasty.AST.Phrase.t() | nil,
  span: Nasty.AST.Node.span(),
  text: String.t(),
  type: role_type()
}

Functions

adjunct_role?(role)

@spec adjunct_role?(t()) :: boolean()

Checks if role is an adjunct (not a core argument).

core_role?(role)

@spec core_role?(t()) :: boolean()

Checks if role is a core argument (not an adjunct).

new(type, text, span, opts \\ [])

@spec new(role_type(), String.t(), Nasty.AST.Node.span(), keyword()) :: t()

Creates a new semantic role.