示例#1
0
    def create_register(self, session, all_names=False):
        """ Create a name register dictionary for this article """
        register = {}
        from queries.builtin import add_name_to_register, add_entity_to_register

        for name in self.person_names():
            add_name_to_register(name, register, session, all_names=all_names)
        # Add register of entity names
        for name in self.entity_names():
            add_entity_to_register(name, register, session, all_names=all_names)
        return register
示例#2
0
    def create_register(self,
                        session: Session,
                        all_names: bool = False) -> "RegisterType":
        """ Create a name register dictionary for this article """
        from queries.builtin import (
            add_name_to_register,
            add_entity_to_register,
            RegisterType,
        )

        register: RegisterType = {}

        for name in self.person_names():
            add_name_to_register(name, register, session, all_names=all_names)
        # Add register of entity names
        for name in self.entity_names():
            add_entity_to_register(name,
                                   register,
                                   session,
                                   all_names=all_names)
        return register