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

View Source

Semantic frame representing a predicate with its arguments and adjuncts.

A frame captures the "who did what to whom, where, when, how" structure of a clause. Each frame is anchored by a predicate (typically a verb) and includes semantic roles for participants and circumstances.

Summary

Functions

Returns adjunct roles (modifiers) only.

Gets the agent role if present.

Returns core roles (arguments) only.

Finds roles of a specific type in the frame.

Creates a new semantic frame.

Gets the patient/theme role if present.

Types

t()

@type t() :: %Nasty.AST.Semantic.Frame{
  predicate: Nasty.AST.Token.t(),
  roles: [Nasty.AST.Semantic.Role.t()],
  span: Nasty.AST.Node.span(),
  voice: :active | :passive | :unknown
}

Functions

adjunct_roles(frame)

@spec adjunct_roles(t()) :: [Nasty.AST.Semantic.Role.t()]

Returns adjunct roles (modifiers) only.

agent(frame)

@spec agent(t()) :: Nasty.AST.Semantic.Role.t() | nil

Gets the agent role if present.

core_roles(frame)

@spec core_roles(t()) :: [Nasty.AST.Semantic.Role.t()]

Returns core roles (arguments) only.

find_roles(frame, type)

Finds roles of a specific type in the frame.

new(predicate, roles, span, opts \\ [])

Creates a new semantic frame.

patient(frame)

@spec patient(t()) :: Nasty.AST.Semantic.Role.t() | nil

Gets the patient/theme role if present.