Unicode::LineBreak::JA_JP(3p)

NAME
Unicode::LineBreak::JA_JP - UAX #14 Unicode XXXXXXXXX

SYNOPSIS
    use Unicode::LineBreak;
    $lb = Unicode::LineBreak->new();
    $broken = $lb->break($string);

DESCRIPTION
Unicode::LineBreak XXUnicode XXXXXX14 [UAX #14] XXXX Unicode XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX11 [UAX #11] XXXXXX East_Asian_Width XXXXXXXXXX

  XX
XXXXXXXXXXXXX

XXXXXmandatory breakXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [UAX #14] XXXXXXXXXXXXXXXXXdirect breakXXXXXXXindirect breakXXXXXX

XXXXXXXXXalphabetic charactersXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXideographic charactersXXXXXXXXXXXXXXXXXXXX [UAX #14] XXXXXXXXXXXXXXXX AL XXXXXXXXXXXXXXXX ID XXXXXXX (XXXXXXXXXXXXXXXXXXXXXXXX)X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXwideXXXXXXnarrowXXXXXXXXXXXnonspacingXXXXXXXXXXXXX 2 XX1 XX0 XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX

PUBLIC INTERFACE

  XXXX

new ([KEY => VALUE, ...])
    XXXXXXXX KEY => VALUE XXXXXXX "XXXXX" XXXX

$self->break (STRING)
    XXXXXXXXXXX Unicode XXX STRING XXXXXXXXXXX

$self->break_partial (STRING)
    XXXXXXXXXXX break() XXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXSTRING XXX "undef" XXXXX

$self->config (KEY)
$self->config (KEY => VALUE, ...)
    XXXXXXXXXXX XXXXXXXXXXXXX KEY => VALUE XXXXXXX "XXXXX" XXXX

$self->copy
    XXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX

  XXXXX

context ([Charset => CHARSET], [Language => LANGUAGE])
    XXX XXXXXXXX CHARSET XXXXXXXX LANGUAGE XXXXXXXXXX/XXXXXXXXX

$self->eawidth (STRING)
    XXXXXXXXXXX Unicode XXX STRING XXXXXXX East_Asian_Width XXXXXX XXXXXXX "XX" XXXX EA_Z XXXXXXXX (XXXX) XXXXXXXX XXX A (XX) XXXXXXXXXXX

$self->lbclass (STRING)
    XXXXXXXXXXX Unicode XXX STRING XXXXXXXXXXXX (XX) XXXX XXXXXXX "XX" XXXX AIXSAXSGXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (XXXXXXXXX) XXXXXXX SA XXXXXXXXX

$self->lbrule (BEFORE, AFTER)
    XXXXXXXXXXX XX BEFORE XXX AFTER XXXXXXXXXXXXX XXXXXXX "XX" XXXX

    X: XXXXXXXXBKXCMXCRXLFXNLXSP XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXAIXSAXSGXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX

$self->strsize (LEN, PRE, SPC, STR)
$self->strsize (LEN, PRE, SPC, STR, MAX)
    XXXXXXXXXXX MAX XXXXXXXX[UAX #11] XXXXXXXXXXXXXXXUnicode XXX PRE.SPC.STR XXXXXXXXX XXX MAX XXXXXXXPRE.SPC.SUBSTR XXXX MAX XXXXXXXX STR XXXXXXXXX SUBSTR XXXXXXXX

  XXXXX
"new"X"config" XXXXXXXXXXXXXXXXXXX

CharactersMax => NUMBER
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXX 998X 0 XXXXXXX

ColumnsMin => NUMBER
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX 0X

ColumnsMax => NUMBER
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX 76X

"UrgentBreaking" XXXXXXXX "XXXXXXXXXXX" XXXX

Context => CONTEXT
    XX/XXXXXXXXXXX XXXXXXXX "EASTASIAN" X "NONEASTASIAN"X XXXXXX "NONEASTASIAN"X

Format => METHOD
    XXXXXXXXXXXXXXXXXX

    "DEFAULT"
        XXXXXX XXXXXXXXXXXXXXXXXX

    "NEWLINE"
        "Newline" XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX

    "TRIM"
        XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX

    XXXXXXXXXX
        "XXXX" XXXX

HangulAsAL => "YES" | "NO"
    XXXXXXXXXXXXXXXXXconjoining jamoXXXXXXXXXX (AL) XXXX XXXX "NO"X

LegacyCM => "YES" | "NO"
    XXXXXXXXXXXXXXXXXXXXXX (ID) XXXX Unicode 5.0 XXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX "YES"X

Newline => STRING
    XXXXXXXXX Unicode XXXX XXXX "\n"X

SizingMethod => METHOD
    XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX

    "DEFAULT"
        XXXXXX strsize() XXXX

    XXXXXXXXXX
        "XXXXXXX" XXXX

    "TailorEA" XXXXXXXXX

TailorEA => "[" ORD "=>" CLASS, ... "]"
    XXXXXX East_Asian_Width XXXXXXXXX ORD XXXX UCS XXXXXXXXXXXXXXXXXXX CLASS X East_Asian_Width XXXXXXX ("XX" XXX)X

    XXXXXXEast_Asian_width XXXXXXXXXXX "XXXXXXXXX" XXXX

TailorLB => "[" ORD "=>" CLASS, ... "]"
    XXXXXXXXXXX (XX) XXXXXXX ORD XXXX UCS XXXXXXXXXXXXXXXXXXX CLASS XXXXXXXXXXX ("XX" XXX)X

    XXXXXXXXXXXXXXXXXXXX "XXXXXXXXX" XXXX

UrgentBreaking => METHOD
    XXXXXXXXXXXXXXXX XXXXXXXXXXXXX

    "CROAK"
        XXXXXXXXXXXXXXXX

    "FORCE"
        XXXXXXXXXXXXXXXXX

    "NONBREAK"
        XXXXXX XXXXXXXXXXXXXX

    XXXXXXXXXX
        "XXXXXXXXXXX" XXXX

UserBreaking => "["METHOD, ..."]"
    XXXXXXXXXXXXXXXXX METHOD XXXXXXXXXXXXXX

    "NONBREAKURI"
        URI XXXXXXX

    "BREAKURI"
        URI XXXXXXXXXXXXXXXXX XXXX [CMOS] X 6.17 XX 7.11 XXXXX

    "[" REGEX, SUBREF "]"
        XXXX REGEX XXXXXXXXXXXSUBREF XXXXXXXXXXXXXXXXXX XXX "XXXXXXXXXXX" XXXX

  XX

"EA_Na", "EA_N", "EA_A", "EA_W", "EA_H", "EA_F", "EA_Z"
    [UAX #11] XXXXXX 6 XX East_Asian_Width XXXXXXXXXXXXXXXXXXXX EA_ZX

"LB_BK", "LB_CR", "LB_LF", "LB_NL", "LB_SP", "LB_OP", "LB_CL", "LB_CP", "LB_QU", "LB_GL", "LB_NS", "LB_EX", "LB_SY", "LB_IS", "LB_PR", "LB_PO", "LB_NU", "LB_AL", "LB_ID", "LB_IN", "LB_HY", "LB_BA", "LB_BB", "LB_B2", "LB_CB", "LB_ZW", "LB_CM", "LB_WJ", "LB_H2", "LB_H3", "LB_JL", "LB_JV", "LB_JT", "LB_SG", "LB_AI", "LB_SA", "LB_XX"
    [UAX #14] XXXXXX 37 XXXXXX (XX) XXXXX

    X: XXX CP XUnicode 5.2.0XXXXXXXX

"MANDATORY", "DIRECT", "INDIRECT", "PROHIBITED"
    XXXXXXXX 4 XXXX

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

"Unicode::LineBreak::SouthEastAsian::supported"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXX "undef"X

    X: XXXXXXXXXXXXXXXXXXXXXXXXXXX

"UNICODE_VERSION"
    XXXXXXXXXXXX Unicode XXXXXXXXXXX

CUSTOMIZATION

  XXXX
"Format" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 3 XXXXXXXXXXXXXXXX

    XXX = &XXXXXX(SELF, EVENT, STR);

SELF X Unicode::LineBreak XXXXXXXEVENT XXXXXXXXXXXXXXXXXXXXXSTR XXXXXXXXXXXX Unicode XXXXXXX

    EVENT |XXXXX           |STR
    -----------------------------------------------------------------
    "sot" |XXXXXX         |XXXXXXX
    "sop" |XXXXXX         |XXXXXX
    "sol" |XXXXXX         |XXXXXXX
    ""    |XXXXX           |XXX (XXXXXXXXXX)
    "eol" |XXXX             |XXXXXXXXXXX
    "eop" |XXXX             |XXXXXXXXXXX
    "eot" |XXXXXX         |XXXXXXXXXXX (XXX)
    -----------------------------------------------------------------

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"undef" XXXXXXX XXX"sot"X"sop"X"sol" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XX: XXXX 1.003 XXXXXXXXXXX Unicode::GCString XXXXXXXXXX "CAVEAT" in Unicode::GCString::JA_JP XXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    sub fmt {
        if ($_[1] =~ /^eo/) {
            return "\n";
        }
        return undef;
    }
    my $lb = Unicode::LineBreak->new(Format => \&fmt);
    $output = $lb->break($text);

  XXXXXXXXXXX
XXXXXXXXXXXXX CharactersMaxXColumnsMinXColumnsMax XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX "UrgentBreaking" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 XXXXXXXXXXXXXXXX

    XXX = &XXXXXX(SELF, LEN, PRE, SPC, STR);

SELF X Unicode::LineBreak XXXXXXXLEN XXXXXXXXXPRE XXXXX Unicode XXXXSPC XXXXXXXXXXXSTR XXXXXX Unicode XXXX

XXXXXXXXXXX STR XXXXXXXXXXXXXXXXXXXXXX

XX: XXXX 1.003 XXXXXXXXXXX Unicode::GCString XXXXXXXXXX "CAVEAT" in Unicode::GCString::JA_JP XXX

XXXXXXXXXXXXXXXXXX (XXXXXXX) XXXXXXXXXXXXXXXXXXXXXXXXX

    sub hyphenize {
        return map {$_ =~ s/yl$/yl-/; $_} split /(\w+?yl(?=\w))/, $_[4];
    }
    my $lb = Unicode::LineBreak->new(UrgentBreaking => \&hyphenize);
    $output = $lb->break("Methionylthreonylthreonylglutaminylarginyl...");

"UserBreaking" XXXXXXXXX [REGEX, SUBREF] XXXXXXXXXXXXXXXXXXXX 2 XXXXXXXXXXXXXXXX

    XXX = &XXXXXX(SELF, STR);

SELF X Unicode::LineBreak XXXXXXXSTR X REGEX XXXXXXXXXXX Unicode XXXX

XXXXXXXXXXX STR XXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXHTTP URL X [CMOS] XXXXXXXXXXXX

    my $url = qr{http://[\x21-\x7E]+}i;
    sub breakurl {
        my $self = shift;
        my $str = shift;
        return split m{(?<=[/]) (?=[^/]) |
                       (?<=[^-.]) (?=[-~.,_?\#%=&]) |
                       (?<=[=&]) (?=.)}x, $str;
    }
    my $lb = Unicode::LineBreak->new(UserBreaking => [$url, \&breakurl]);
    $output = $lb->break($string);

  XXXXXXX
"SizingMethod" XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 5 XX 6 XXXXXXXXXXXXXXXX

    XX = &XXXXXX(SELF, LEN, PRE, SPC, STR);

    XXX = &XXXXXX(SELF, LEN, PRE, SPC, STR, MAX);

SELF X Unicode::LineBreak XXXXXXXLEN XXXXXXXXXXXXPRE XXXXX Unicode XXXXSPC XXXXXXXXXXXSTR XXXXX Unicode XXXX

XXXXXXXXXXXXXXXXX "PRE.SPC.STR" XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX"ColumnsMin" XXXXXXXX "ColumnsMax" XXXXXXXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXX STR XXXXXXX Unicode XXXXXXXXXXXXXXXXXXXXXXXXX SUBSTR X PRE.SPC.SUBSTR XXXX MAX XXXXXXXXXXXXXXXX "UrgentBreaking" XXXXXX "FORCE" XXXXXXXXXXXXXXXXXXXXXXXXXX"undef" XXXXXXXXXXXX

XX: XXXX 1.003 XXXXXXXXXXX Unicode::GCString XXXXXXXXXX "CAVEAT" in Unicode::GCString::JA_JP XXX

XXXXXXXXXXXXX 8 XXXXXXXXXXXXXXXXXXXXXXX

    sub tabbedsizing {
        my ($self, $cols, $pre, $spc, $str, $max) = @_;
        return undef if $max;

        my $spcstr = $spc.$str;
        while ($spcstr =~ s/^( *)(\t+)//) {
            $cols += length($1);
            $cols += length($2) * 8 - $cols % 8;
        }
        $cols += $self->strsize(0, '', '', $spcstr);
        return $cols;
    };
    my $lb = Unicode::LineBreak->new(TailorLB => [ord("\t") => LB_SP],
                                     SizingMethod => \&tabbedsizing);
    $output = $lb->break($string);

  XXXXXXXXX
"TailorLB" XXXXXXXX "TailorEA" XXXXXXXXXXXXXXXXX (XX) X East_Asian_Width XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

XXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXX (NS) XXXX XXXXX TailorLB XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (ID) XXXXX

"KANA_NONSTARTERS() => LB_ID"
    XXXXXXXXX

"IDEOGRAPHIC_ITERATION MARKS() => LB_ID"
    XXXXXXXXXXXXX U+3005 XXXXXXU+303B XXXXXU+309D XXXXXXXXXU+309E XXXXXXXX (XX)XU+30FD XXXXXXXXXU+30FE XXXXXXXX (XX)X

    XXXXXXXXXXXXXX

"KANA_SMALL_LETTERS() => LB_ID"
"KANA_PROLONGED_SOUND_MARKS() => LB_ID"
    XXXXXX XXXXXX U+3041 X, U+3043 X, U+3045 X, U+3047 X, U+3049 X, U+3063 X, U+3083 X, U+3085 X, U+3087 X, U+308E X, U+3095 X, U+3096 XX XXXXXX U+30A1 X, U+30A3 X, U+30A5 X, U+30A7 X, U+30A9 X, U+30C3 X, U+30E3 X, U+30E5 X, U+30E7 X, U+30EE X, U+30F5 X, U+30F6 XX XXXXXXX U+31F0 X - U+31FF XX XXXXXX (XXXX) U+FF67 X - U+FF6F XX

    XXXXX U+30FC XXXXXU+FF70 XXXX (XXXX)X

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX[JIS X 4051] 6.1.1 XXX

    XXU+3095 X, U+3096 X, U+30F5 X, U+30F6 X XXXXXXXXXXXX

"MASU_MARK() => LB_ID"
    U+303C XXXXX

    XXXXXXXXXXXXXXXXX "XX" X "XX" XXXXXXXXXXXX

    XXXXXXX [UAX #14] XXXXXXXX (NS) XXXXXXXX[JIS X 4051] XXXXXXX (13) (ID XXX) XXXXXXX

East_Asian_Width XX

XXXXXXXXXXXXXXXXXXXXXXXXXXXX (A) X East_Asian_Width XXXXXXXXXXXXXXXXXXXXXX "EASTASIAN" XXXXXXXXXXXXX "TailorEA => [ AMBIGUOUS_"*"() => EA_N ]" XXXXXXXXXXXXXXXXXXXXXXXXXXX

"AMBIGUOUS_ALPHABETICS() => EA_N"
    XXXXXXXXX East_Asian_Width XX N (XX) XXXXXXX

"AMBIGUOUS_CYRILLIC() => EA_N"
"AMBIGUOUS_GREEK() => EA_N"
"AMBIGUOUS_LATIN() => EA_N"
    XX (A) XXXXXXXXXXXXXXXXXXXXXXXXXX (N) XXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXUnicode XXXXXX (F) XXXXXXXXXXXXXX (Na) XXXXXXXXXXXXXXXXTailorEA XXXXXXXXXXXXXXXXXXXXXXXXXXX "EASTASIAN" XXXXXXXXXXXX

"QUESTIONABLE_NARROW_SIGNS() => EA_A"
    U+00A2 XXXXXXU+00A3 XXXXXXU+00A5 XXX (XXXXXX)XU+00A6 XXXXU+00AC XXXU+00AF XXXXX

  XXXXXX
"new" XXXXXXX "config" XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX Unicode/LineBreak/Defaults.pmX XXX Unicode/LineBreak/Defaults.pm.sample XXXXXXXX

BUGS
XXXXXXXXXXXXXXXXXXXXXXXXX

CPAN Request Tracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Unicode-LineBreak <http://rt.cpan.org/Public/Dist/Display.html?Name=Unicode-LineBreak>.

VERSION
$VERSION XXXXXXXXXXX

XXXXXXXXXXXX http://hatuka.nezumi.nu/repos/Unicode-LineBreak/ <http://hatuka.nezumi.nu/repos/Unicode-LineBreak/> XXXX

  XXXXXXX
XXXXXXXXXXXXXXXXXXXXXUnicode XX 6.0.0 XXXXX

XXXXXXXXXXXXXX UAX14-C2 XXXXXXXXXXX

•   XXXXXXXXXXXX NS XXXXXX ID XXXXXXXXXXX

•   XXXXXXXXXXXXXXXXXXX ID XXXXXX AL XXXXXXXXXXX

•   AI XXXXXXXXX AL X ID XXXXXXXXXXXXXXX

•   CB XXXXXXXXXXXXXXX

•   XXXXXXXXXXXXXXXXXXXXXXXXX SA XXXXXXXXX AL XXXXXX XXXXGrapheme_Cluster_Break XXXXX Extend X SpacingMark XXXXXX CM XXXXXX

•   SG X XX XXXXXXXXX AL XXXXXX

•   XXX UCS XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

        XX               | lbclass()  | eawidth()  | XX
        -------------------------------------------------------------
        U+3400..U+4DBF     | ID         | W          | CJKXX
        U+4E00..U+9FFF     | ID         | W          | CJKXX
        U+D800..U+DFFF     | AL (SG)    | N          | XXXXX
        U+E000..U+F8FF     | AL (XX)    | F X N (A) | XXXX
        U+F900..U+FAFF     | ID         | W          | CJKXX
        U+20000..U+2FFFD   | ID         | W          | CJKXX
        U+30000..U+3FFFD   | ID         | W          | CJKXX
        U+F0000..U+FFFFD   | AL (XX)    | F X N (A) | XXXX
        U+100000..U+10FFFD | AL (XX)    | F X N (A) | XXXX
        XXXXXXXX   | AL (XX)    | N          | XXXXX
        -------------------------------------------------------------

•   XXXXXXXXX MnXMeXCcXCfXZlXZp XXXXXXXXXXXX[UAX #11] XXXXXXXX East_Asian_Width XXXXXXXXXXXXXXXXXXXXXXXX Z (XXXXXXX) XXXX

REFERENCES

[CMOS]
    The Chicago Manual of Style, 15th edition. Chicago University Press, 2003.

[JIS X 4051]
    JIS X 4051:2004 XXXXXXXXXX. XXXXXX, 2004.

[UAX #11]
    A. Freytag (2008-2009). Unicode Standard Annex #11: East Asian Width, Revision 17-19. <http://unicode.org/reports/tr11/>.

[UAX #14]
    A. Freytag and A. Heninger (2008-2010). Unicode Standard Annex #14: Unicode Line Breaking Algorithm, Revision 22-25. <http://unicode.org/reports/tr14/>.

SEE ALSO
Text::LineFold::JA_JP, Text::Wrap.

AUTHOR
Copyright (C) 2009, 2010 Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu>.

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