Skip to content

Improve Korean metadata search and automatic book matching - #64

Closed
studphc wants to merge 1 commit into
Billiam:mainfrom
studphc:agent/improve-korean-book-matching
Closed

studphc wants to merge 1 commit into
Billiam:mainfrom
studphc:agent/improve-korean-book-matching

Conversation

@studphc

@studphc studphc commented Jul 31, 2026 •

Copy link
Copy Markdown

Background

Korean EPUB metadata often includes subtitles, parenthetical edition labels, series or volume markers, and author role suffixes such as 지음, 저, 글, 옮김, and 번역. ISBN values may also contain spaces or hyphens.

Passing these values directly to Hardcover can miss an existing Korean edition or surface unrelated results. One concrete case was 아인슈타인의 냉장고, whose full Korean subtitle and author/translator role metadata did not produce a safe automatic match.

Changes

  • Preserve the original title and author while producing separate normalized values for Korean searches.
  • Conservatively remove Korean subtitle separators, edition/volume qualifiers, and standalone labels such as (장편소설).
  • Remove Korean author and translator role suffixes while retaining the primary author.
  • Normalize ISBN-10 and ISBN-13 values by removing spaces and hyphens and validating their checksums.
  • Keep the lookup order as:
    1. ISBN
    2. Original title and author
    3. Normalized title and author
    4. Normalized Korean title only, when author-indexed searches miss
  • Score search results using title and author similarity instead of automatically selecting the first result.
  • Allow near-exact Korean titles when Hardcover stores the author in a different script, for example 한강 versus Han Kang.
  • Keep the existing non-Korean findBooks path unchanged.
  • Document the Korean lookup order, examples, compatibility guarantees, installation path, and catalog limitations in the README.
  • Add focused unit coverage for Korean normalization, ISBN validation, fallback ordering, unrelated-result rejection, and non-Korean behavior.

Validation

  • busted: 58 successes, 0 failures, 0 errors
  • Lua 5.1 syntax validation passed for all .lua files with luac5.1 -p
  • Live, read-only Hardcover API checks:
    • Exact ISBN lookup succeeded for 5/5 Korean editions: 소년이 온다, 채식주의자, 작별하지 않는다, 아몬드, and 불편한 편의점
    • Subtitle and role normalization matched 소년이 온다 : 1980년 5월 광주 / 한강 지음
    • The Korean title-only fallback matched 작별하지 않는다 (장편소설) / 한강 저 when the author-indexed query returned no results
    • The existing English lookup for The Vegetarian / Han Kang continued to match correctly

Risks / follow-up

  • The title-only fallback is limited to Korean metadata and still passes through the same similarity threshold before automatic linking.
  • Duplicate Hardcover work records can remain ambiguous without an ISBN; ISBN lookup remains the highest-confidence path.
  • Some existing Hardcover editions have incomplete language metadata. Exact valid ISBN matches are still accepted.
  • This PR does not add Aladin integration or create Hardcover catalog records. An Aladin lookup and opt-in edition-creation workflow should be designed as a separate follow-up.

@studphc
studphc force-pushed the agent/improve-korean-book-matching branch 2 times, most recently from 5161c34 to 782f80a Compare July 31, 2026 05:10
@studphc
studphc force-pushed the agent/improve-korean-book-matching branch from 782f80a to 489bf0e Compare July 31, 2026 05:11
@studphc studphc closed this Jul 31, 2026
@studphc
studphc deleted the agent/improve-korean-book-matching branch July 31, 2026 05:58
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.

1 participant