The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Lingua::JA::Hepburn::Passport - Hepburn Romanization using Japanese passport rules


  use utf8;
  use Lingua::JA::Hepburn::Passport;

  my $hepburn = Lingua::JA::Hepburne::Passport->new;
  $hepburn->romanize("みやがわ");     # MIYAGAWA
  $hepburn->romanize("おおの");       # ONO
  $hepburn->romanize("かとう");       # KATO
  $hepburn->romanize("ゆうこ");       # YUKO
  $hepburn->romanize("なんば");       # NAMBA
  $hepburn->romanize("はっちょう");   # HATCHO

  # Indicate long vowels by "h"
  my $hepburn = Lingua::JA::Hepburne::Passport->new( long_vowels_h => 1 );
  $hepburn->romanize("おおの");       # OHNO
  $hepburn->romanize("かとう");       # KATOH


Lingua::JA::Hepburn::Passport is a Hiragana/Katakana to Romanization engine using Japanese passport rules. There're already some Hepburn romanization modules on CPAN but none of them conform to the one used in Japanese passport, hence I made another one.


  $hepburn = Lingua::JA::Hepburn::Passport->new;
  $hepburn = Lingua::JA::Hepburn::Passport->new( long_vowels_h => 1 );

Creates new object. Optionally you can pass long_vowels_h parameter to 1, with which this module tries to add H to the long vowels OO and OU, as allowed in Japanese passport rules.

  $roman = $hepburn->romanize( $kana );

Romanizes the string $kana using Hepburn romanization. $kana should be either Hiragana or Katakana, as an Unicode string in Perl (a.k.a UTF-8 flagged), otherwise it throws an error. Returned $roman would be all upper case roman letters.

This module doesn't come with deromanize method (yet), which would do the Roman to Katakana/Hiragana translation, since I don't think we need it. Other modules on CPAN alaredy do the job quite nicely.


Tatsuhiko Miyagawa <>


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Some of the code algorithm are ripped off from

SEE ALSO,, Lingua::JA::Romanize::Kana