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

View Source

Modality node representing epistemic and deontic modality.

Modality expresses the speaker's attitude toward the proposition: necessity, possibility, certainty, obligation, permission, etc.

Summary

Types

Strength of the modal (0.0 to 1.0).

Modality type classification.

t()

Types

modal_strength()

@type modal_strength() :: float()

Strength of the modal (0.0 to 1.0).

  • 1.0 = Strong modality ("must", "certainly")
  • 0.5 = Medium modality ("should", "probably")
  • 0.0 = Weak modality ("might", "possibly")

modality_type()

@type modality_type() ::
  :certainty
  | :probability
  | :possibility
  | :necessity
  | :obligation
  | :permission
  | :ability

Modality type classification.

  • :certainty - High confidence ("certainly", "definitely")
  • :probability - Likely but not certain ("probably", "likely")
  • :possibility - May or may not be true ("possibly", "maybe")
  • :necessity - Required ("must", "have to")
  • :obligation - Expected ("should", "ought to")
  • :permission - Allowed ("can", "may")
  • :ability - Capable of ("can", "able to")

t()

@type t() :: %Nasty.AST.Semantic.Modality{
  marker: Nasty.AST.Token.t(),
  span: Nasty.AST.Node.span(),
  strength: modal_strength(),
  type: modality_type()
}