Lingua::ZH::HanDetect - Guess Chinese text's variant and encoding


Lingua-ZH-HanDetect documentation  | view source Contained in the Lingua-ZH-HanDetect distribution.

Index


NAME

Top

Lingua::ZH::HanDetect - Guess Chinese text's variant and encoding

VERSION

Top

This document describes version 0.04 of Lingua::ZH::HanDetect, released June 27, 2003.

SYNOPSIS

Top

    use Lingua::ZH::HanDetect;

    # $encoding is 'big5-hkscs', 'big5', 'gbk', 'euc-cn', 'utf8' or ''
    # $variant  is 'traditional', 'simplified' or ''
    my ($encoding, $variant) = han_detect($some_chinese_text);

DESCRIPTION

Top

Lingua::ZH::HanDetect uses statistical measures to test a text string to see if it's in Traditional or Simplified Chinese, as well as which encoding it is in.

If the string does not contain Chinese characters, both the encoding and variant values will be set to the empty string.

This module is needed because the various encodings for Chinese text tend to occupy the similar byte ranges, rendering Encode::Guess ineffective.

SEE ALSO

Top

Encode::HanDetect

AUTHORS

Top

Autrijus Tang <autrijus@autrijus.org>

COPYRIGHT

Top


Lingua-ZH-HanDetect documentation  | view source Contained in the Lingua-ZH-HanDetect distribution.