Пример #1
0
 def set_address(self):
     if self.has_non_empty_attribute("adres"):
         if utils.contains_digit(self.adres):
             town = utils.remove_markup(self.plaats)
             address = "{}, {}".format(self.adres, town)
             self.add_statement("located_street", address)
         else:
             self.add_to_report("adres", self.adres, "located_street")
Пример #2
0
    def set_directions(self):
        """
        Set directions / address.

        Use street address if 'address' contains digits,
        otherwise add as directions.
        """
        if self.has_non_empty_attribute("address"):
            if utils.contains_digit(self.address):
                self.add_statement("located_street", self.address)
            else:
                monolingual = utils.package_monolingual(self.address, 'hy')
                self.add_statement("directions", monolingual)
Пример #3
0
    def set_street_address(self):
        """
        Set the street address.

        These all have nice looking street addresses, which, however,
        do not include the municipality name.
        So add it to the address after stripping potential
        bracketed part.
        """
        if utils.contains_digit(self.adresse):
            city_clean = utils.get_rid_of_brackets(self.gemeinde)
            address = "{}, {}".format(self.adresse, city_clean)
            self.add_statement("located_street", address)
Пример #4
0
    def set_address(self):
        """
        Set the street address.

        Only if the 'address' field contains a digit.
        Form the address as "$address, $municipality".
        """
        if self.has_non_empty_attribute("address"):
            address = utils.remove_markup(self.address)
            if utils.contains_digit(address):
                placename = utils.remove_markup(self.municipality)
                street_address = "{}, {}".format(address, placename)
                self.add_statement("located_street", street_address)
            else:
                directions = utils.package_monolingual(address, 'ka')
                self.add_statement("directions", directions)
Пример #5
0
    def set_street_address(self):
        """
        Set the street address.

        Works if the source data contains a digit.
        Since the place is not included, transpose
        it from the place name.
        """
        if self.has_non_empty_attribute("adresse"):
            addr_raw = utils.remove_markup(self.adresse)
            if utils.contains_digit(addr_raw):
                settlement = utils.remove_markup(self.site)
                address = "{}, {}".format(addr_raw, settlement)
                self.add_statement("located_street", address)
            else:
                monolingual = utils.package_monolingual(addr_raw, 'fr')
                self.add_statement("directions", monolingual)
Пример #6
0
    def set_address(self):
        """
        Set address / directions.

        Address, with attached city, if there's digits in it.
        Otherwise directions.
        """
        if self.has_non_empty_attribute("address"):
            if utils.contains_digit(self.address):
                if self.has_non_empty_attribute("city"):
                    city_no_brackets = utils.get_rid_of_brackets(self.city)
                    address = "{}, {}".format(self.address, city_no_brackets)
                else:
                    address = self.address
                self.add_statement("located_street", address)
            else:
                dirs = utils.package_monolingual("sr", self.address)
                self.add_statement("directions", dirs)