Upgrade to Pro — share decks privately, control downloads, hide ads and more …

e-book title normalization

nasa9084
October 20, 2024

e-book title normalization

at YAPC::Hakodate 2024

nasa9084

October 20, 2024
Tweet

More Decks by nasa9084

Other Decks in Technology

Transcript

  1. $ whoami • @nasa9084 • Hakodate - Sapporo - Asaka

    - Sapporo • Go/Kubernetes • builderscon 2024 Organizer • Kubernetes SIG Docs Localization Subproject (Japanese)
  2. Can't we share a single account? • ALL contents will

    be shared • Sometimes I don't want to share some • Reading state will be shared • Everyone can buy any on Amazon
  3. Amazon Kids • can create multiple pro fi les •

    can share contents YOU WANT TO for each pro fi le • each pro fi le can have each reading state
  4. ΫϏΩϦαΠΫϧ ੨৭αϰΝϯͱٔݴݣ͍ ΫϏγϝϩϚϯνετ ਓࣦؒ֨ɾྵ࡚ਓࣝ ΫϏπϦϋΠεΫʔϧ ٔݴݣ͍ͷఋࢠ (ߨஊࣾจݿ) αΠίϩδΧϧʢ্ʣ 㙽௻໦ᆇีͷٔݴࡴ͠ (ߨஊࣾจݿ)

    αΠίϩδΧϧʢԼʣɹӪ͔ΕऀͷখӖ (ߨஊࣾจݿ) ώτΫΠϚδΧϧɹࡴፋحज़ͷ೏ٶܑຓ (ߨஊࣾจݿ) ωίιΪϥδΧϧʢதʣɹ੺͖੐ࡋ͂ͅɽᒵͳΔछ (ߨஊࣾจݿ) ωίιΪϥδΧϧʢԼʣɹ੨৭αϰΝϯͱٔݴݣ͍ (ߨஊࣾจݿ) ωίιΪϥδΧϧʢ্ʣɹेࡾ֊ஈ (ߨஊࣾจݿ) ΩυφϓΩσΟϯάɹ੨৭αϰΝϯͱٔݴݣ͍ͷ່ (ߨஊࣾϊϕϧε)
  5. Normalize replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(re placeAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(repl aceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replac eAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(prop("Name"), "̍", "1"), "̎", "2"), "̏",

    "3"), "̐", "4"), "̑", "5"), "̒", "6"), "̓", "7"), "̔", "8"), "̕", "9"), "̌", "0"), "ᶃ", "1"), "ᶄ", "2"), "ᶅ", "3"), "ᶆ", "4"), "ᶇ", "5"), "ᶈ", "6"), "ᶉ", "7"), "ᶊ", "8"), "ᶋ", "9"), "ᶌ", "10"), "ʢ", "("), "ʣ", ")"), "ɹ", " "), "ୈҰू", "ୈ1ू"), "ୈೋू", "ୈ2ू"), "ୈࡾू", "ୈ3ू"), "ୈ࢛ू", "ୈ4ू"), "ୈޒू", "ୈ5ू"), "ୈ࿡ू", "ୈ6ू"), "ୈࣣू", "ୈ7ू"), "ୈീू", "ୈ8ू"), "ୈ۝ू", "ୈ9ू"), "ୈेू", "ୈ10ू"), "ˌ", "#")
  6. Extract Episode Number match(prop("rmBrand"), "(^\d+ )|(^\d+: ([^ ]+)?)|(^#\d+)|(^\dרʮ[^ʮʯ]+ʯ)|(\([্தԼ]\))|([্தԼ]$)| (ୈ?\d+[רू]:?(( ʮ[^ʯ]+ʯଞ?)|(

    ʮ[^ʯ]+ ଞʯ)|( ʰ[^ʱ]+ ଞʱ))?)|(\(\d+\) ? ~ .+$|(\(\d+\))|(ʲ\d+ʳ)| (:? ?(Vol\.)?\d+ *$)|(\d{4}೥ ?(\d\.)?\d{1,2}݄߸(\(vol.\d+\))?$)|(ୈ.෦ ?ʮ[^ʮʯ]+[0-9IVX]+ʯ( ?ຊ޷͖ ͷԼႥ্ ୈ[Ұೋࡾ࢛ޒ࿡ࣣീ۝े]෦)?$)|([IVX]+[ ~ ].+$)|( [^ ]+ฤ( \d+)?)$)")