+
+ @staticmethod
+ def start_import(args, loader):
+ """
+ Create the SPImporter object containing the right
+ sp loader and then start the import of special phrases.
+ """
+ from ..tokenizer import factory as tokenizer_factory
+
+ tokenizer = tokenizer_factory.get_tokenizer_for_db(args.config)
+ should_replace = not args.no_replace
+ with connect(args.config.get_libpq_dsn()) as db_connection:
+ SPImporter(
+ args.config, args.phplib_dir, db_connection, loader
+ ).import_phrases(tokenizer, should_replace)