{"action":"closed","issue":{"url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/41","labels_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/41/comments","events_url":"https://api.github.com/repos/infolab-csail/WikipediaBase/issues/41/events","html_url":"https://github.com/infolab-csail/WikipediaBase/issues/41","id":91826300,"number":41,"title":"Rendered Attributes Missing Space(s)","user":{"login":"michaelsilver","id":5913522,"avatar_url":"https://avatars.githubusercontent.com/u/5913522?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsilver","html_url":"https://github.com/michaelsilver","followers_url":"https://api.github.com/users/michaelsilver/followers","following_url":"https://api.github.com/users/michaelsilver/following{/other_user}","gists_url":"https://api.github.com/users/michaelsilver/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsilver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsilver/subscriptions","organizations_url":"https://api.github.com/users/michaelsilver/orgs","repos_url":"https://api.github.com/users/michaelsilver/repos","events_url":"https://api.github.com/users/michaelsilver/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsilver/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-29T14:48:59Z","updated_at":"2015-08-21T15:17:36Z","closed_at":"2015-08-21T15:17:36Z","body":"I have noticed that for some attribute mappings fetched with\r\n```Python\r\n>>> from wikipediabase.util import get_infobox, get_meta_infobox\r\n>>> get_meta_infobox('<TEMPLATE_NAME>').rendered_keys()\r\n```\r\nthe rendered attributes are missing spaces between words. For example:\r\n```Python\r\n>>> from wikipediabase.util import get_infobox,\r\nget_meta_infobox\r\n>>> get_meta_infobox('Template:Infobox weapon').rendered_keys()\r\n{'origin': u'Place\\xa0of\\xa0origin',\r\n'diameter': 'Diameter',\r\n'traverse': 'Traverse',\r\n'secondary_armament': 'Secondaryarmament',\r\n'hilt_type': u'Hilt\\xa0type',\r\n'weight': 'Weight',\r\n'max_range': u'Maximum\\xa0firing\\xa0range',\r\n'guidance': 'Guidancesystem',\r\n'armour': 'Armour',\r\n'sights': 'Sights',\r\n'number': u'Number\\xa0built',\r\n'height': 'Height',\r\n'barrels': 'Barrels',\r\n'rate': u'Rate\\xa0of\\xa0fire',\r\n'caliber': 'Calibre',\r\n'yield': u'Blast\\xa0yield',\r\n'range': u'Effective\\xa0firing\\xa0range',\r\n'cartridge_weight': 'Shell weight',\r\n'pw_ratio': 'Power/weight',\r\n'speed': 'Speed',\r\n'feed': u'Feed\\xa0system',\r\n'depth': 'Maximum depth',\r\n'service': u'In\\xa0service',\r\n'production_date': 'Produced',\r\n'altitude': 'Flight altitude',\r\n'carriage': 'Carriage',\r\n'crew': 'Crew',\r\n'width': 'Width',\r\n'primary_armament': 'Mainarmament',\r\n'transport': 'Transport',\r\n'suspension': 'Suspension',\r\n'haft_type': u'Haft\\xa0type',\r\n'type': 'Type',\r\n'detonation': 'Detonationmechanism',\r\n'accuracy': 'Accuracy',\r\n'engine': 'Engine',\r\n'ceiling': 'Flight ceiling',\r\n'designer': 'Designer',\r\n'elevation': 'Elevation',\r\n'propellant': 'Propellant',\r\n'cartridge': 'Shell',\r\n'blade_type': u'Blade\\xa0type',\r\n'used_by': u'Used\\xa0by',\r\n'wars': 'Wars',\r\n'filling_weight': u'Warhead\\xa0weight',\r\n'boost': 'Boost time',\r\n'recoil': 'Recoil',\r\n'breech': 'Breech',\r\n'sheath_type': 'Scabbard/sheath',\r\n'variants': 'Variants',\r\n'steering': 'Steeringsystem',\r\n'manufacturer': 'Manufacturer',\r\n'passengers': 'Passengers',\r\n'launch_platform': 'Launchplatform',\r\n'part_length': u'Barrel\\xa0length',\r\n'transmission': 'Transmission',\r\n'head_type': u'Head\\xa0type',\r\n'fuel_capacity': u'Fuel\\xa0capacity',\r\n'design_date': 'Designed',\r\n'wingspan': 'Wingspan',\r\n'length': 'Length',\r\n'vehicle_range': 'Operationalrange',\r\n'filling': 'Warhead',\r\n'engine_power': 'Engine',\r\n'unit_cost': u'Unit\\xa0cost',\r\n'action': 'Action',\r\n'velocity': u'Muzzle\\xa0velocity',\r\n'clearance': u'Ground\\xa0clearance',\r\n'payload_capacity': u'Payload\\xa0capacity'}\r\n```\r\nThese rendered attributes probably should have spaces but don't: `Secondaryarmament`, `Guidancesystem`, `Mainarmament`, `Detonationmechanism`, `Steeringsystem`, `Launchplatform`, `Operationalrange`. I have seen this problem in other infoboxes such as: `Template:Infobox firearm cartridge` (`Detonationmechanism`), `Template:Infobox military unit` (`Electronicwarfare`, `Notablecommanders`, `Currentcommander`), `Template:Infobox military conflict` (`Territorialchanges`). BTW, I'm not a war nut or anything... it just seems like this is happening with a lot of military related infoboxes :)\r\n\r\nThis is a particularly bad problem, because there is no way for me to just eliminate these attributes by regex matching.\r\n\r\nThis issue may be related to whether the rendered attribute gets split into two lines (with no space between when the linebreak is removed). See \"Operational Range\" in the infobox on this page: https://en.wikipedia.org/wiki/BM-21_Grad\r\n\r\nI also notice that some rendered strings are unicode, and some are not -- don't know whether this is related to the problem, but worth noticing. FYI, I'm able to transform all the unicode string into clean non-unicode, properly turning `\\xa0` into a space by using \r\n```Python\r\n>>> from unidecode import unidecode\r\n>>> unidecode('<unicode string>')\r\n```"}}