Nasty.Language.Spanish.Adapters.CoreferenceResolverAdapter (Nasty v0.3.0)

View Source

Adapter that bridges Spanish.CoreferenceResolver to generic Semantic.CoreferenceResolution.

This adapter provides Spanish-specific configuration while delegating the core coreference resolution algorithm to the language-agnostic implementation.

Configuration

Spanish-specific settings:

  • Spanish pronouns (él, ella, ellos, ellas, lo, la, los, las)
  • Spanish reflexive pronouns (se, sí, consigo)
  • Gender agreement rules for Spanish
  • Number agreement (singular/plural)
  • Spanish possessives (su, sus, suyo, suya)

Summary

Functions

Resolves coreference chains in Spanish text.

Functions

resolve(document, opts \\ [])

@spec resolve(
  Nasty.AST.Document.t(),
  keyword()
) :: {:ok, [Nasty.AST.Semantic.CorefChain.t()]} | {:error, term()}

Resolves coreference chains in Spanish text.

Identifies mentions (pronouns, proper names, definite noun phrases) and clusters them into coreference chains based on Spanish-specific features.

Options

  • :max_distance - Maximum sentence distance for coreference (default: 3)
  • :min_confidence - Minimum confidence threshold (default: 0.5)
  • :use_gender - Use gender agreement (default: true)
  • :use_number - Use number agreement (default: true)

Examples

iex> {:ok, chains} = CoreferenceResolverAdapter.resolve(spanish_document)
{:ok, [%CorefChain{representative: "María García", mentions: ["María García", "ella", "la"]}, ...]}

iex> {:ok, chains} = CoreferenceResolverAdapter.resolve(doc, max_distance: 5)
{:ok, [%CorefChain{...}]}