def __init__(self, config=None, group="unknown", dataset="unknown"):
        """
        Arguments:
        ---------

        config : a AssocParserConfig object
        """
        self.config = config
        if config is None:
            self.config = assocparser.AssocParserConfig()
        self.report = assocparser.Report(group=group, dataset=dataset, config=self.config)
        self.gpi = None
        if self.config.gpi_authority_path is not None:
            self.gpi = dict()
            parser = entityparser.GpiParser()
            with open(self.config.gpi_authority_path) as gpi_f:
                entities = parser.parse(file=gpi_f)
                for entity in entities:
                    self.gpi[entity["id"]] = {
                        "symbol": entity["label"],
                        "name": entity["full_name"],
                        "synonyms": entitywriter.stringify(entity["synonyms"]),
                        "type": entity["type"]
                    }

                print("Loaded {} entities from {}".format(len(self.gpi.keys()), self.config.gpi_authority_path))
def __init__ ( self , config = None , group = "unknown" , dataset = "unknown" ) : self . config = config if config is None : self . config = assocparser . AssocParserConfig ( ) self . report = assocparser . Report ( group = group , dataset = dataset , config = self . config ) self . gpi = None if self . config . gpi_authority_path is not None : self . gpi = dict ( ) parser = entityparser . GpiParser ( ) with open ( self . config . gpi_authority_path ) as gpi_f : entities = parser . parse ( file = gpi_f ) for entity in entities : self . gpi [ entity [ "id" ] ] = { "symbol" : entity [ "label" ] , "name" : entity [ "full_name" ] , "synonyms" : entitywriter . stringify ( entity [ "synonyms" ] ) , "type" : entity [ "type" ] } print ( "Loaded {} entities from {}" . format ( len ( self . gpi . keys ( ) ) , self . config . gpi_authority_path ) )
Arguments:
        ---------

        config : a AssocParserConfig object