<commit_before><?php require_once "common.inc";

# $Id: election2007.php,v 1.17 2007/10/04 23:05:43 frabcus Exp $

# The Public Whip, Copyright (C) 2003 <NAME> and <NAME>
# This is free software, and you are welcome to redistribute it under
# certain conditions.  However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in the top level of the source.

# 2007 General Election special

# TODO:
# Update wales_constituencies etc.
# Sort out postcode lookup for new boundaries
# Error handling of failed postcode lookup don't work
# Update links to other quizes
# Get standing again data, and remove XXX remove me
# Independents - north wales, and george galloway
# Fix shorter URL redirecting
# Maybe display anyway when postcode wrong
# At least say you need javascript
# Question from hell backwards for LRRB

# TODO old:
# Think about dream/person distance, check it works OK
# Do redirect stuff, using interstitial and cookies?

$postcode_year = 2005;
$date_clause = "entered_house <= '2007-11-01' and '2007-11-01' <= left_house";

require_once "db.inc";
require_once "decodeids.inc";
require_once "dream.inc";
require_once "pretty.inc";
require_once "constituencies.inc";
require_once "account/user.inc";

require_once "election2007articles.inc";
require_once "election2007questions.inc";
require_once "election2007constituencies.inc";

$db = new DB();
$db2 = new DB();


$ranks = array(
        "strongly for" => 1.0,
        "moderately for" => 0.75,
        "neutral/mixed on" => 0.50,
        "moderately against" => 0.25,
        "strongly against" => 0.0,
        "don't know about" => 0.50,
    );

# Commented out ids are the original Dream MPs now turned into policies.
# Uncommented out ones are frozen Dream MPs copied from election time.
$issues = array(
        array(999, "<strong>investigating</strong> the <strong>Iraq war</strong>", false),
        array(996, "<strong>Freedom of Information</strong> applying to <strong>MPs</strong>", false), # XXX not 2007 specific
        array(863, "<strong>Government</strong> altering the law <strong>without Parliament</strong>", true), # XXX not 2007 specific
        array(1000, "the <strong>smoking ban</strong>", false),
        array(984, "replacing the <strong>Trident nuclear weapons</strong>", false), # XXX not 2007 specific
        # XXX terrorism - there are loads of votes
        # XXX ID cards - there are loads of votes
    );
$policystrnum = array("iraq"=>0, "foia"=>1, "lrrb"=>2, "smoking"=>3, "trident"=>4);
$policynumstr = array_flip($policystrnum);

// Name in database => display name
$parties = array(
    "Lab" => "Labour",
    "Con" => "Conservative",
    "LDem" => "Liberal Democrat",
);
<commit_msg>Add terrorism and id cards. Use new dream mp numbers.<commit_after><?php require_once "common.inc";

# $Id: election2007.php,v 1.18 2007/10/04 23:11:28 publicwhip Exp $

# The Public Whip, Copyright (C) 2003 <NAME> and <NAME>
# This is free software, and you are welcome to redistribute it under
# certain conditions.  However, it comes with ABSOLUTELY NO WARRANTY.
# For details see the file LICENSE.html in the top level of the source.

# 2007 General Election special

# TODO:
# Update wales_constituencies etc.
# Sort out postcode lookup for new boundaries
# Error handling of failed postcode lookup don't work
# Update links to other quizes
# Get standing again data, and remove XXX remove me
# Independents - north wales, and george galloway
# Fix shorter URL redirecting
# Maybe display anyway when postcode wrong
# At least say you need javascript
# Question from hell backwards for LRRB

# TODO old:
# Think about dream/person distance, check it works OK
# Do redirect stuff, using interstitial and cookies?

$postcode_year = 2005;
$date_clause = "entered_house <= '2007-11-01' and '2007-11-01' <= left_house";

require_once "db.inc";
require_once "decodeids.inc";
require_once "dream.inc";
require_once "pretty.inc";
require_once "constituencies.inc";
require_once "account/user.inc";

require_once "election2007articles.inc";
require_once "election2007questions.inc";
require_once "election2007constituencies.inc";

$db = new DB();
$db2 = new DB();


$ranks = array(
        "strongly for" => 1.0,
        "moderately for" => 0.75,
        "neutral/mixed on" => 0.50,
        "moderately against" => 0.25,
        "strongly against" => 0.0,
        "don't know about" => 0.50,
    );

# Commented out ids are the original Dream MPs now turned into policies.
# Uncommented out ones are frozen Dream MPs copied from election time.
$issues = array(
        array(999, "<strong>investigating</strong> the <strong>Iraq war</strong>", false),
        array(1001, "<strong>Freedom of Information</strong> applying to <strong>MPs</strong>", false),
        array(1002, "<strong>Government</strong> altering the law <strong>without Parliament</strong>",
true),
        array(1000, "the <strong>smoking ban</strong>", false),
        array(1003, "replacing the <strong>Trident nuclear weapons</strong>", false),
        array(1004, "Labour's <strong>anti-terrorism laws</strong>", true),
        array(1005, "introducing <strong>ID cards</strong>", true),
    );

$policystrnum = array("iraq"=>0, "foia"=>1, "lrrb"=>2, "smoking"=>3, "trident"=>4,
    "terrorism"=>5, "idcards"=>6);
$policynumstr = array_flip($policystrnum);

// Name in database => display name
$parties = array(
    "Lab" => "Labour",
    "Con" => "Conservative",
    "LDem" => "Liberal Democrat",
);

{'fraction_non_alphanumeric': 0.1255466472303207, 'fraction_numerical': 0.04063411078717201, 'mean_word_length': 4.129906542056075, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4299812', 'n_tokens_mistral': 1895, 'n_tokens_neox': 1674, 'n_words': 586}