mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
230 stars 53 forks source link

Oddly marking-up words following semi-colons as strong #735

Open gwire opened 9 years ago

gwire commented 9 years ago

The first word after some semi-colons in this speech has been marked-up as strong for some unclear reason, as it doesn't appear to be there in the Hansard source.

http://www.theyworkforyou.com/debates/?id=2015-01-05c.54.1

<p class="" pid="c.54.1/2" pwmotiontext="yes">In November, 
this House passed a Modern Slavery Bill to tackle the appalling
crime of modern slavery, to pursue and prosecute those who
trade in human beings for profit, and to protect and support victims.
Modern slavery is just one of the many manifestations of serious 
and organised crime, and while organised criminals operate
globally, the effects of their crimes reach deep into our communities,
shattering lives and affecting us all in different ways: the pensioner
who loses his life savings to a sophisticated scam; 
<br><strong>the</strong> family who have their home burgled by
someone addicted to drugs; <br><strong>the</strong> internet
user who has their credit card details stolen; 
<br><strong>the</strong> person who buys goods such as alcohol
or medicines and discovers they are dangerous fakes; 
<br><strong>and</strong> people who find their insurance premiums
inflated because of fraud. Organised crime can also relate to the
disgusting and devastating sexual exploitation of children.</p>
dracos commented 9 years ago

It is trying to make long motion texts a bit clearer, such as this one: http://www.theyworkforyou.com/debates/?id=2014-12-17b.1480.0

https://github.com/mysociety/theyworkforyou/blob/master/www/includes/easyparliament/templates/html/hansard_gid.php#L420-L424 is what does it, based upon parser code at https://github.com/mysociety/parlparse/blob/master/pyscraper/debate/filterdebatespeech.py#L43-L50 Improved handling welcome :) I guess it should ignore if the first "beg to move" is a whole sentence, or if there's only one thing emboldened, highlight the word after "and", and so on.