def _fill_link_entity(self, entity, gid, link): entity.catalog_id = gid entity.url = link entity.is_wiki = url_utils.is_wiki_link( link) entity.tokens = ' '.join( url_utils.tokenize(link))
def _fill_link_entity(entity, gid, link): entity.catalog_id = gid entity.url = link entity.is_wiki = url_utils.is_wiki_link(link) url_tokens = url_utils.tokenize(link) if url_tokens: entity.url_tokens = ' '.join(url_tokens)
def _fill_link_entity(self, entity: BaseLinkEntity, identifier, url): entity.catalog_id = identifier entity.url = url entity.is_wiki = url_utils.is_wiki_link(url) entity.url_tokens = ' '.join(url_utils.tokenize(url)) if isinstance(entity, DiscogsMusicianLinkEntity): self.musician_links += 1 elif isinstance(entity, DiscogsGroupLinkEntity): self.band_links += 1
def _alias_entities(self, entity: BaseEntity, aliases_class, aliases: []): for alias_label in aliases: alias_entity = aliases_class() alias_entity.catalog_id = entity.catalog_id alias_entity.born = entity.born alias_entity.born_precision = entity.born_precision alias_entity.died = entity.died alias_entity.died_precision = entity.died_precision alias_entity.birth_place = entity.birth_place alias_entity.death_place = entity.death_place alias_entity.name = alias_label alias_entity.tokens = " ".join(url_utils.tokenize(alias_label)) yield alias_entity