Geoparser

class Geoparser(recognizer: ~geoparser.modules.recognizers.base.Recognizer | None = <object object>, resolver: ~geoparser.modules.resolvers.base.Resolver | None = <object object>, spacy_model: str | None = None, transformer_model: str | None = None)

Bases: object

User-facing interface for the geoparser functionality.

Provides a simple parse method for processing texts with configured recognizer and resolver. The Geoparser creates a new project for each parse operation, making it stateless by default.

parse(texts: str | List[str], save: bool = False) List[Document]

Parse one or more texts with the configured recognizer and resolver.

This method creates a new project for each parse operation, processes the texts, and returns the results. By default, the project is deleted after processing to keep the parse method stateless.

Parameters:
  • texts – Either a single document text or a list of texts

  • save – If True, preserve the project after processing. If False (default), delete the project to maintain stateless behavior.

Returns:

List of Document objects with processed references and referents from the configured recognizer and resolver.