Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Add link from vote to relevant part in matching plenum protocol #169

Closed
ofri opened this issue Oct 14, 2013 · 5 comments · Fixed by #346
Closed

Add link from vote to relevant part in matching plenum protocol #169

ofri opened this issue Oct 14, 2013 · 5 comments · Fixed by #346

Comments

@ofri
Copy link
Member

ofri commented Oct 14, 2013

in vote, such as http://oknesset.org/vote/6196/ it would be nice to have a link to the relevant part in the plenum protocol http://oknesset.org/plenum/7678/ - the correct plenum meeting can be easily found by date (there is only 1 plenum protocol per day. possible edge case - votes that are after midnight might be in the plenum protocol of the previous date! need to check this). the relevant part inside the protocol may be found by using vote.vote_number, and matching it against a protocol part header (see below).

from datetime import date
p = Committee.objects.get(name='Plenum')
// p is the plenum "committee" object.
m = p.meetings.get(date=date(2013, 03, 19))
// m is the meeting object. m.protocol_text is a bulb of text of the protocol, m.parts is the protocol, parsed to small chunks.

parts = m.parts.filter(header__contains=u'הצבעה')
// these are all the parts that have הצבעה in their name. each should also have a number. just find the one where the number matches vote.vote_number. we'll assume we put it in the variable part
part.get_absolute_url should give you the direct link to it.

The link should be added using the Links app. need to make sure it is presented in the vote page.
Link.objects.create(...)

This whole thing should be written as a management command, with options to run it on all the votes in the db, or just on votes from last x days.

@ofri
Copy link
Member Author

ofri commented Oct 16, 2013

an example of the edge case that i mentioned: http://oknesset.org/vote/?vtype=all&tagged=all&order=time&from_date=2013-08-01&to_date=2013-08-01 - all of these votes were in 1/8, but their relevant protocol is actually in 31/7. the meeting just ended after midnight.

@OriHoch
Copy link

OriHoch commented Nov 4, 2013

I'm on it..

@OriHoch
Copy link

OriHoch commented Nov 4, 2013

We have the specific meeting number in the plenum protocol text - it would be better to use that instead of relying on date.

The problem is that the number is in words (הישיבה השישים-ושתיים של הכנסת התשע-עשרה)

I opened a task for hackita to write a library that converts numbers in words to the numbers themselves - https://hackita.hasadna.org.il/hashmabirs/41/

I'll wait for that task to complete to continue with this issue

@Daphna-Shalev
Copy link

Hi Ori!
Just checked the issue.
In the example protocol (http://oknesset.org/plenum/7814/), just above where it says "הישיבה השישים-ושתיים של הכנסת התשע-עשרה", the number of plenum is actually given, in gematria!
For example, in that protocol it says ישיבה ס"ב. I believe that given this detail, we might not be needing a conversion library. A Python dictionary or similar to map between the Heb letters and their values should be sufficient then, correct?

Daphna :)

@OriHoch
Copy link

OriHoch commented Nov 19, 2013

thanks @Daphna-Shalev , I haven't noticed that, should be much easier

we also need the knesset number but I think we can deduce that from the date of the meeting

http://he.wikipedia.org/wiki/%D7%A1%D7%A4%D7%A8%D7%95%D7%AA_%D7%A2%D7%91%D7%A8%D7%99%D7%95%D7%AA

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants