Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added NBallot multiplier parsing #91

Merged
merged 2 commits into from
Jul 16, 2018

Conversation

carlschroedl
Copy link
Member

Addresses #90
This work makes it easy to concisely simulate elections, which will help implement #52 and pivot-libre/pivot#156.

Later, if/when we remove the NBallot class, the NBallot Parser can be retained. It will simply return an array of N regular Ballot instances instead of one NBallot instance.

@coveralls
Copy link

coveralls commented Jul 6, 2018

Coverage Status

Coverage increased (+2.5%) to 84.142% when pulling 6078304 on carlschroedl:nBallotParsing#90 into 11ca883 on pivot-libre:0.x.

This is most useful with parsing a tie-breaking Ballot.
@carlschroedl
Copy link
Member Author

I reviewed the Codacy results. I choose not to fix them.

@@ -9,6 +9,10 @@ class CandidateRankingParser
{
private const ORDERED_DELIM = ">";
private const EQUAL_DELIM = "=";
Copy link
Member Author

@carlschroedl carlschroedl Jul 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you like the prohibition of these characters from text that should be parsed into a CandidateRanking or a Ballot? I'm trying to prevent someone from passing 100*A>B>C into CandidateRankingParser or BallotParser and winding up with Candidates 100*A, B,C, when what they really want is to pass the same text to NBallotParser and get candidates A, B, C voted for 100 times.

@carlschroedl carlschroedl merged commit 0f737d1 into pivot-libre:0.x Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants