Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (15 sloc) 0.585 kB
#!/usr/bin/perl -l
# jaencode - encode a number in Japanese syllables
use strict;
use warnings;
# missing: a i u e o n chi tsu shi (non-uniform length)
use Number::Nary -codec_pair => {
digits => [ qw(
ka ki ku ke ko ta te to sa su se so na ni nu ne no ha
hi fu he ho ma mi mu me mo ya yu yo ra ri ru re ro wa wo
), ]
};
sub xlate { $_[0] =~ /[a-z]/ ? decode($_[0]) : encode($_[0]) }
if (@ARGV == 0) { die "usage: jaencode <string>\n" }
elsif (@ARGV == 1) { print xlate($ARGV[0]); }
else { print $_ . ": " . xlate($_) for @ARGV }
Jump to Line
Something went wrong with that request. Please try again.