Page MenuHomePhabricator

Automatically hyphenate ISBNs
Closed, DeclinedPublic

Description

Author: circeus

Description:
It should be easy enough to do: ISBN ranges are very documented and a parser should be doable. See http://www.isbn-international.org/converter/ranges.htm for the list. Besides, theoretically, the proper way to display ISBNs is with hyphens.


Version: unspecified
Severity: enhancement

Details

Reference
bz10685

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:51 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz10685.
bzimport added a subscriber: Unknown Object (MLST).

michaeldaly wrote:

Looking at the documentation, that isn't a trivial task - straightforward, but not trivial. Since there are old 10 digit ISBNs still in use and new 13 digit ISBNs, should both sets of rules be used or should only the new 13 digit ISBNs be processed?

According to the ISBN web site, either hyphens or spaces are appropriate.

circeus wrote:

But I don't think Mediawiki actually support spaces. And the hyphenation is identical for isbn-10 and -13. ISBN-13 do not change hyphenation.They only add the 978- prefix (and may alter the check digit, but that is beyond the scope of hyphenation).

randolph.j.finder wrote:

I would like to help program this if possible? I also found everything needed to determine the proper spacing for either an ISBN-10 or ISBN-13 regardless of which nation. Does the WONTFIX indicate that a decision has been made that this shouldn't be done?

happy.melon.wiki wrote:

It was WONTFIXed by a senior dev (Rob Church), but with no comment. I can't see any particular reason why this *shouldn't* be done (although I could well be missing something given the close). Certainly nothing will be committed without his OK, but if you want to spend the time on it, go ahead; if you can do it cleanly and efficiently, that might resolve whatever issue it was WONTFIXed for.

randolph.j.finder wrote:

What language is development in, PHP? The program would primarily be referencing the tables at http://www.isbn-international.org/en/identifiers/List-of-Ranges.pdf and the code would look something like http://usin.org/software/servers/ISBN-ISSN.phps (Don't want to copy it directly, but definitely right idea. :)

The way that the table would be referenced for ISBN-10 is to find the line that has the first piece of the ISBN in the first column, where the next chunk is between the two next fields, and then also cut before the check digit, so 4789654321 would be hyphenated after the 4 (since 4 is in the first column alone, and then after the 7896 since since 7896 is between 7000 and 8499 and then before the 1 (assuming 1 is the appropriate check digit) and would become 4-7896-5432-1. For ISBN-13 just put the initial 978 in its own group. It may also make sense as part of the same effort to figure out how to react on either mislength or mischeckdigit situations.

happy.melon.wiki wrote:

Yes, MediaWiki is written almost entirely in PHP; our coding conventions are set out at [[mw:Manual:Coding conventions]], although they are not prescriptive.

randolph.j.finder wrote:

Clicking on that link gave me a "Bad Title" page, could you please check on it? Thank You.

happy.melon.wiki wrote:

Ah, seems that mw is not a local interwiki prefix on wikipedia. The full url is http://www.mediawiki.org/wiki/Coding_Conventions