如何自动应用 ISBN 连字符?

发布于 2024-10-02 00:53:14 字数 377 浏览 0 评论 0原文

我有不带破折号的 ISBN 号码(10 位和 13 位)。 现在我正在寻找一种自动添加这些破折号的方法。

我在这里找到了一些有用的信息: http://www.isbn.org/standards/home/isbn /international/hyphenation-instructions.asp

但我不确定它是否可行,因为 发布者标识符具有随机长度,并且没有 了解这一点后,可能无法确定 破折号的正确位置。

有人知道是否有可能吗?

多谢!

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:
http://www.isbn.org/standards/home/isbn/international/hyphenation-instructions.asp

But I'm not sure if it's doable at all, because the
publisher identifier has a random length, and without
knowing it, it's maybe not possible to determine the
correct positions for the dashes.

Does anybody know if it's possible somehow?

Thanks a lot!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梅窗月明清似水 2024-10-09 00:53:14

如果您有完整范围表,则可以推断出发布商标识符的长度。

示例 1. ISBN 0141439564(企鹅:远大前程

  • 组标识符为 0(英语)。
  • 该组的发布商范围为 00–19、200–699、7000–8499、85000–89999、900000-949999 和 9500000–9999999
  • 接下来的两位数字是 14,在 00–19 范围内,因此发布商有 2 位数字。
  • 因此,连字符形式为 0-14-143956-4

示例 2. ISBN 2253004227(Poche:Germinal

  • 组标识符为 2(法语)
  • 该组的出版商范围为 00–19, 200 –349, 35000–39999, 400–699, 7000–8399, 84000–89999, 900000–949999, 9500000–9999999
  • 接下来的三位数字是 253,在 200–349 范围内,因此出版商有 3 位
  • 数字连字符形式为 2-253-00422-7

您可以在美国国会图书馆的 检查您的算法ISBN 连字符工具

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: Germinal)

  • 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.

失而复得 2024-10-09 00:53:14

对于 Python,您可以使用库 python-stdnumisbnidisbn_连字符。他们可以用连字符连接 ISBN,并使用其他答案中提到的范围表。

For Python, you can use the library python-stdnum, isbnid or isbn_hyphenate. They can hyphenate ISBNs, and use the range table mentioned in the other answer.

始于初秋 2024-10-09 00:53:14

我编写了以下 JavaScript 函数来连接 ISBN(我知道还有 isbnjs,但这是我认为更紧凑,更容易包含在其他项目中)。

https://gist.github.com/aurimasv/6693537

I wrote the following JavaScript function to hyphenate ISBNs (I know there is also isbnjs, but this is more compact and easier to include in other projects I think).

https://gist.github.com/aurimasv/6693537

他夏了夏天 2024-10-09 00:53:14

看一下 https://pypi.python.org/pypi/isbntools,它将允许您可以“连字符”ISBN 等等,例如提取、清理、转换和获取元数据。

这是一个库(您可以在程序中使用),但它安装了几个可以从命令行使用的“脚本”。

Take a look at https://pypi.python.org/pypi/isbntools, it will allow you to 'hyphenate' ISBNs and much more, like extracting, cleanning, transforming, and get metadata.

This is a library (that you can use in your program) but it installs several 'scripts' that you can use from the command line.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文