Nasty.AST.Semantic.Frame (Nasty v0.3.0)
View SourceSemantic 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
@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
@spec adjunct_roles(t()) :: [Nasty.AST.Semantic.Role.t()]
Returns adjunct roles (modifiers) only.
@spec agent(t()) :: Nasty.AST.Semantic.Role.t() | nil
Gets the agent role if present.
@spec core_roles(t()) :: [Nasty.AST.Semantic.Role.t()]
Returns core roles (arguments) only.
@spec find_roles(t(), Nasty.AST.Semantic.Role.role_type()) :: [ Nasty.AST.Semantic.Role.t() ]
Finds roles of a specific type in the frame.
@spec new( Nasty.AST.Token.t(), [Nasty.AST.Semantic.Role.t()], Nasty.AST.Node.span(), keyword() ) :: t()
Creates a new semantic frame.
@spec patient(t()) :: Nasty.AST.Semantic.Role.t() | nil
Gets the patient/theme role if present.