Nasty.Language.English.SRLConfig (Nasty v0.3.0)

View Source

English-specific configuration for Semantic Role Labeling.

Provides:

  • Passive auxiliary patterns
  • Passive participle detection
  • Temporal adverb recognition
  • Preposition-to-role mappings

Summary

Functions

Returns the complete configuration map for use with generic SRL modules.

Check if a token is a passive auxiliary.

Check if a token is a passive participle.

Returns the preposition-to-role mapping.

Check if text is a temporal adverb.

Functions

config()

Returns the complete configuration map for use with generic SRL modules.

passive_auxiliary?(token)

@spec passive_auxiliary?(Nasty.AST.Token.t()) :: boolean()

Check if a token is a passive auxiliary.

Returns true for forms of "be" (was, were, is, are, been, being, be).

passive_participle?(token)

@spec passive_participle?(Nasty.AST.Token.t()) :: boolean()

Check if a token is a passive participle.

Heuristics:

  • Morphology indicates :past_participle
  • Ends in -ed (regular verbs)
  • Ends in -en (some irregular verbs: written, taken, etc.)
  • Has POS tag indicating past participle (if available)
  • If it's a verb (not -ing form), assume it could be participle (for irregular verbs like "read", "cut", "put" that don't change form)

preposition_role_map()

@spec preposition_role_map() :: map()

Returns the preposition-to-role mapping.

Maps preposition strings (lowercase) to semantic role atoms.

temporal_adverb?(text)

@spec temporal_adverb?(String.t()) :: boolean()

Check if text is a temporal adverb.

Returns true for adverbs like "yesterday", "now", "always", etc.