Tool implementations

This package contains various implementations of the different search engine tools.

See also

interfaces

The tools interfaces definitions

config

The default configuration instantiates tools from this package

Savers

class swisstext.cmd.searching.tools.console_saver.ConsoleSaver(**kwargs)[source]

Bases: swisstext.cmd.searching.interfaces.ISaver

Implementation of an ISaver useful for testing and debugging. It does not persist any results, but prints everything to the console instead.

__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

save_seed(seed: swisstext.cmd.searching.data.Seed, was_used: bool)[source]

[ABSTRACT] Should persist a seed and, if was_used is true, its associated results.

class swisstext.cmd.searching.tools.mongo_saver.MongoSaver(host='localhost', port=27017, db='st1', **kwargs)[source]

Bases: swisstext.cmd.searching.interfaces.ISaver

This ISaver implementation persists everything to a MongoDB database.

See also

swisstext.mongo

Package defining the Mongo collections.

__init__(host='localhost', port=27017, db='st1', **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

Test if the url already exists in the persistence layer. Returns false by default.

save_seed(seed: swisstext.cmd.searching.data.Seed, was_used: bool)[source]

[ABSTRACT] Should persist a seed and, if was_used is true, its associated results.

seed_exists(seed: str, **kwargs) → bool[source]

Return whether a seed already exist in the backend.