-
Notifications
You must be signed in to change notification settings - Fork 1
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
Candidate tokens: mechanism for bare token to fullname token mapping? #8
Comments
I made suggestion b, but I think c is also a good choice. b could be amended to work for comments at the end or for more than one data item per key. There are several cases where I would expect to see lists or key value lists in the metadata --- the choices list, the division list, and withdrawn choices (choices included in the data but for which votes will not be counted, possibly SBJ in the example, depending on the rules). Every list type will need its own marker or to have a section header, which is why I prefer b over c, we can define as many list types as are needed without worrying about what symbols are available. |
I am indifferent between "a" and "c", having currently implemented "a" in votelib (but "c" would be easy as well). Both "a" and "c" have the advantages of not having to maintain parser state across lines, and I also find both of them readable, which should IMHO be an important concern. |
Over on issue #1 in (#issuecomment-900871094 on Aug 18), @simberaj noted:
Yup, the EBNF-based implementation that I built in July accepts both Proposals "a" and "c" above:
Illustrated by this example: "
Illustrated by this example: " Given @brainbuz 's implicit preference for Proposal "c" over "a" from his earlier comments, and given the thinking I've been doing about this, I like "c" better. The equals (" Proposal "a" ("
The example above alternates between Proposals "a" and "c", which probably shouldn't work in any self-respecting ABIF implementation. Here's the error returned by the EBNF-based implementation that I wrote:
My hunch is that It experienced an accidental failure, but I'm not sure. Regardless, this case (or some variation thereof) is almost certainly going to be the next test case in the test suite. |
Ooops, I figured out that my |
I'm convinced by your arguments. I would not introduce deprecated features at the very start, so let's stick to Proposal "c" as the only variant. I am only tempted to give a chance to a variant that makes the initial equals-sign optional... |
Thanks for the prompt reply, @simberaj . Let's close this issue with proposal "c":
Thus this will be valid ABIF:
Implementations that numerically-assign candidates with a fixed identifier (or "bare token") can use a letter of their choosing, followed by digits, and then the candidate name as follows:
...or if they really want to be verbose, they can also spell it out:
I don't remember for sure if underscore ( p.s. regarding @simberaj 's comment "I am only tempted to give a chance to a variant that makes the initial equals-sign optional...": I'm tempted to drop the equals-sign (or make it optional) as well, but I'm afraid of making that change yet. One of us should reopen this issue (or create a new issue) if we really want to press that case. |
As of this writing (in June 2021) the testcases all propose the following way to map between fullname tokens and bare tokens (proposal "a"):
The reason why I chose that ordering is because it makes the square bracket the first character of the line, and makes it possible to determine what the line type is by the first character. However, over in issue #5 , @brainbuz suggested reversing the order, and including an explicit section header at the top (proposal "b"):
I believe that we should make it possible to infer the section that a line is in from the first character of the line, and have a convention (rather than a requirement) of using comments to delimit sections for readability for now. We may want to make sections more explicit in the near future, but my hunch is that having line-based section identification will force us to make the line formats we design more robust (and human readable) and will also encourage more robust implementations without too much burden. We should discuss the generalities of my hunch over in issue #6.
On the subject of mapping bare tokens to fullname tokens, I would like to propose a hybrid of the two proposals above (proposal "c"):
My new proposal "c" has a distinct character ("
=
") at the beginning of each line, and implies a sort of prefix notation for the "=
" operator (that is, using the word "operator" really loosely). It still seems best to require that arbitrary strings are enclosed in square brackets, so that we have the option to add things to the line without too much hassle, and so that it's possible to put comments on the end of each line:My question: what should our mechanism for mapping bare candidate tokens to fullname candidate tokens?
=candidates
" section which allows for bare token followed by bare freeform string on each line=
"), followed by bare token, then colon (":
"), then fullname tokenI'm leaning toward my new proposal "c", but I'm open to new suggestions and/or defense of the suggestions outlined above.
The text was updated successfully, but these errors were encountered: