NAME

Data::Validate::Japanese - Validate Japanese Input

SYNOPSIS

use Data::Validate::Japanese;
my $dvj = Data::Validate::Japanese->new;
$ok = $dvj->is_hiragana($data);
$ok = $dvj->is_katakana($data);
$ok = $dvj->is_kanji($data);
$ok = $dvj->is_h_katakana($data);

$dvj->contains_only($value, { 
  hiragana   => 1,
  katakana   => 1,
  kanji      => 1,
  h_katakana => 1,
  ascii      => 1
});

DESCRIPTION

Data::Validate::Japanese aims to be the base (or at least, the common link between) the myriad different data validator infrastructures, and their Japanese-specific extensions. There are just too many validators with too many different interfaces, but it's not like the core handling of Japanese characters change.

METHODS

All methods return true or false unless otherwise stated. All methods also expect Japanese characters that have successfully been decoded to Perl's internal unicode format.

new()

Creates a new instance of Data::Validate::Japanese

is_hiragana($value)

Checks if a value contains half-width katakana only. Returns true or false

is_katakana($value)

Checks if a value contains half-width katakana only. Returns true or false

is_kanji($value)

Checks if a value contains half-width katakana only. Returns true or false

is_h_katakana($value)

Checks if a value contains half-width katakana only. Returns true or false

is_ascii($value)

Checks if a value contains only ascii

contains_only($value, \%candidates)

Checks if a value contains characters within the range from the list of candidates

AUTHORS

Copyright (c) 2007 Daisuke Maki <daisuke@endeworks.jp>

LICENSE

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