Skip to content

Auto-generate Citation Keys #16

@Rindrics

Description

@Rindrics

Description

Automatically generate citation keys in author-year-first-three-words format during import. Japanese keys should be romanized automatically.

Dependencies

Requirements

Key Format

{author_lastname}-{year}-{first_three_words_of_title}

Example:

Input Generated Key
Author: 諏訪正樹, Year: 2018, Title: 身体が生み出すクリエイティブ suwa-2018-karadaga-umidasuku
Author: John Smith, Year: 2020, Title: The Art of Programming smith-2020-the-art-of

Japanese Romanization

  • Convert Japanese characters (hiragana, katakana, kanji) to romaji
  • Use a consistent romanization system (e.g., Hepburn)
  • Handle edge cases:
    • Mixed Japanese/English text
    • Author names with multiple kanji readings

Tasks

  • Research romanization libraries (e.g., kuroshiro, wanakana)
  • Implement key generation logic
  • Integrate with make import target
  • Handle duplicate key detection and resolution
  • Add tests for various input patterns

Technical Considerations

  • Kanji romanization may require dictionary lookup (kuroshiro + kuromoji)
  • Consider fallback for unknown kanji readings
  • Key should be lowercase with hyphens as separators
  • Strip special characters from generated keys

Example Implementation

// Pseudocode
function generateKey(author, year, title) {
  const authorRoman = romanize(getLastName(author));
  const titleWords = romanize(title).split(' ').slice(0, 3).join('-');
  return `${authorRoman}-${year}-${titleWords}`.toLowerCase();
}

Deliverables

  • Key generation module
  • Integration with import workflow
  • Documentation for key format

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions