How to automatically apply ISBN hyphenation?

前端 未结 4 1340
花落未央
花落未央 2021-01-31 11:03

I\'ve got ISBN numbers (10-digits and 13 digits) without the dashes. Now I\'m looking for a way to add those dashes automatically.

I found some useful information here:

4条回答
  •  清酒与你
    2021-01-31 11:26

    You can deduce the length of the publisher identifier if you have the full range tables.

    Example 1. ISBN 0141439564 (Penguin: Great Expectations)

    • The group identifier is 0 (English language).
    • The publisher ranges for this group are 00–19, 200–699, 7000–8499, 85000–89999, 900000-949999, and 9500000–9999999
    • The next two digits are 14, which is in the range 00–19, so the publisher has 2 digits.
    • So the hyphenated form is 0-14-143956-4

    Example 2. ISBN 2253004227 (Poche: Gérminal)

    • The group identifier is 2 (French language)
    • The publisher ranges for this group are 00–19, 200–349, 35000–39999, 400–699, 7000–8399, 84000–89999, 900000–949999, 9500000–9999999
    • The next three digits are 253, which is in the range 200–349, so the publisher has 3 digits
    • So the hyphenated form is 2-253-00422-7

    You can check your algorithm at the Library of Congress's ISBN hyphenation tool.

提交回复
热议问题