POD2::J...neBreak(3)
💖 NAME 💖
This is the User Contributed Perl Documentation page for POD2::J...neBreak(3), aka the manual for Unicode::LineBreak~[ja] — UAX #14 Unicode 行分割アルゴリズム. Bestie, we are literally about to understand Unicode line breaking. 💅
✨ SYNOPSIS ✨
use Unicode::LineBreak;
$lb = Unicode::LineBreak->new();
$broken = $lb->break($string);
🦋 DESCRIPTION 🦋
Okay so Unicode::LineBreak runs the Unicode line breaking algorithm described in Unicode 標準の附属書14 [UAX #14]. When it decides where the breaks go, it also considers the East_Asian_Width 参考特性 (reference property) defined in 附属書11 [UAX #11]. It's giving thorough. 👑
🌸 用語 🌸
For convenience, these terms are used:
- 強制分割〔mandatory break〕 — a line-breaking action defined by the basic rules; it is obligatory and happens regardless of the surrounding characters. No vibe check, it just happens. 💀
- 任意分割 — a line-breaking action permitted by the basic rules; it happens if the user decides to do it. The optional breaks defined in [UAX #14] include 直接分割〔direct break〕 and 間接分割〔indirect break〕. Slay. ✨
- 音素文字的な文字〔alphabetic characters〕 — usually characters that cannot be line-broken between themselves unless other characters give a break opportunity. 🤝
- 表語文字的な文字〔ideographic characters〕 — usually characters that can be line-broken before or after them. 🎀
In [UAX #14], most 音素文字的な文字 are classified as AL, and most 表語文字的な文字 are classified as ID. (These terms are inaccurate from a 文字学 perspective — yes, Unicode said what it said. 😭)
In some writing systems, the break position isn't clear from the individual characters, so a dictionary-based 発見的方法 (heuristic method) is used. iykyk. 🔍
Width tea, because 桁数 is not the same as character count:
- The 桁数 (column count) of a string is not necessarily equal to the number of characters in the string. Not me assuming otherwise. 🙈
- Each character is either 広い〔wide〕, 狭い〔narrow〕, or 前進を伴わない〔nonspacing〕, and they occupy
2桁,1桁, or0桁 respectively. - Some characters can be wide or narrow depending on the context in which they're used. Context is main character energy. 💅
- Customization can give characters more varied widths. Fancy. 🌈
💖 PUBLIC INTERFACE 💖
🧚 行の分割 🧚
new ([KEY => VALUE, ...])— constructor bestie ✨. For theKEY => VALUEpairs, peep"オプション"(the options section).break (STRING)— instance method. Splits the Unicode stringSTRINGand returns it. In array context, it returns an array of each resulting line 💅.break_partial (STRING)— instance method. Same asbreak(), but for when you're feeding the string in little by little. To show that the input is complete, pass"undef"as theSTRINGargument 🫶.config (KEY)/config (KEY => VALUE, ...)— instance method. Gets or changes configuration. For theKEY => VALUEpairs, see"オプション".copy— copy constructor. Makes a duplicate of the object instance 🎀.
🦋 情報の取得 🦋
breakingRule (BEFORESTR, AFTERSTR)— instance method. Gets the line-breaking behavior between the stringsBEFORESTRandAFTERSTR. For the return values, see"定数".
Note: this method only returns a value that describes the rough line-breaking behavior. If you actually want to fold real text, use methods like break() 💖.
context ([Charset => CHARSET], [Language => LANGUAGE])— function. From the character setCHARSETand language codeLANGUAGE, gets the language/region context that uses it 🌍.
🛍️ オプション 🛍️
Both the new and config methods accept the following pairs. Some of these affect width calculation ([E]), grapheme cluster segmentation ([G]) (also see Unicode::GCString~[ja]), and line-breaking behavior ([L]) 👑.
BreakIndent => "YES" | "NO"—[L]Always allow a break after a run of leadingSPACEcharacters (indentation). [UAX #14] does not consider this kind of use ofSPACE. Initial value is"YES".
Note: this option was introduced in release 1.011.
CharMax => NUMBER—[L]The maximum number of characters a line can contain, excluding trailing whitespace and the newline string. Heads up: character count generally does not represent line length. Initial value is998. It cannot be0.ColMin => NUMBER—[L]The minimum number of columns for an optionally broken line, excluding the newline string and trailing whitespace. Initial value is0.ColMax => NUMBER—[L]The maximum number of columns for a line, excluding the newline string and trailing whitespace. In other words, the maximum line length. Initial value is76.
Also see the "Urgent" option and "ユーザ定義の行分割動作".
ComplexBreaking => "YES" | "NO"—[L]Does heuristic line folding in complex Southeast Asian contexts. Initial value is"YES"if word segmentation for Southeast Asian writing systems is enabled.Context => CONTEXT—[E][L]Specifies the language/region context. The currently usable contexts are"EASTASIAN"and"NONEASTASIAN". The initial context is"NONEASTASIAN".
In the "EASTASIAN" context, characters whose East_Asian_Width property is Ambiguous (A) are treated as “wide”, and characters whose line-breaking property is AI are treated as ideographic (ID) 🏮.
In the "NONEASTASIAN" context, characters whose East_Asian_Width property is Ambiguous (A) are treated as “narrow”, and characters whose line-breaking property is AI are treated as alphabetic (AL).
EAWidth => "[" ORD "=>" PROPERTY "]"/EAWidth => "undef"—[E]Manually adjusts theEast_Asian_Widthproperty of individual characters.ORDis a character’s UCS index value, or a reference to an array of those.PROPERTYis either anEast_Asian_Widthproperty value or an extension value (see"定数"). This option can be specified multiple times. If you pass"undef", all previous manual adjustments are canceled.
By default, no tweaks are made to the East_Asian_width property. Also see "文字の特性の手直し".
Format => METHOD—[L]Specifies the method for formatting the split lines."SIMPLE"— the initial method. Just inserts a newline at optional break positions."NEWLINE"— replaces the newline with whatever is specified by the"Newline"option. Removes whitespace before the newline and at the end of the text. Adds a newline if there isn’t one at the end of the text."TRIM"— inserts a newline at optional break positions. Removes whitespace before the newline."undef"— does nothing (not even insert newlines).
サブルーチンへの参照 — see "行の整形".
HangulAsAL => "YES" | "NO"—[L]Treats Hangul syllables and Hangul conjoining jamo as alphabetic characters (AL). Initial value is"NO".LBClass => "[" ORD "=>" CLASS "]"/LBClass => "undef"—[G][L]Manually adjusts the line-breaking property (class) of individual characters.ORDis a character’s UCS index value, or a reference to an array of those.CLASSis one of the line-breaking property values (see"定数"). This option can be specified multiple times. If you pass"undef", all previous manual adjustments are canceled.
By default, no tweaks are made to line-breaking properties. Also see "文字の特性の手直し".
LegacyCM => "YES" | "NO"—[G][L]Treats a combining character preceded by whitespace as a standalone combining character (ID). Since Unicode 5.0, this kind of whitespace usage is not recommended. Initial value is"YES".Newline => STRING—[L]The Unicode string to use as the newline string. Initial value is"\n".Prep => METHOD—[L]Adds a user-defined line-breaking behavior. This option can be specified multiple times.METHODcan be one of the following:"NONBREAKURI"— does not break URIs."BREAKURI"— breaks URIs according to rules suitable for printed material. For details, see sections6.17and17.11of [CMOS]."[" REGEX, SUBREF "]"— splits strings matching the regular expressionREGEXusing the subroutine referenced bySUBREF. For details, see"ユーザ定義の行分割動作"."undef"— cancels all previously added behaviors.
Sizing => METHOD—[L]Specifies the method for calculating string length. The following options can be used:"UAX11"— the initial method. Calculates character width using the built-in character database."undef"— returns the number of grapheme clusters contained in the string (seeUnicode::GCString).
サブルーチンへの参照 — see "文字列長の算出".
Also see the "ColMax", "ColMin", and "EAWidth" options.
Urgent => METHOD—[L]Specifies how to handle lines that are too long. The following options can be used:"CROAK"— outputs an error message and dies 💀."FORCE"— forcibly splits the too-long string."undef"— the initial method. Does not split too-long strings either.
サブルーチンへの参照 — see "ユーザ定義の行分割動作".
ViramaAsJoiner => "YES" | "NO"—[G]Does not separate a virama symbol (called “halant” in Hindi, and “foot” in Khmer script) from the character that follows it. Initial value is"YES". Note: this option was introduced in release2011.001_29. In earlier releases it was fixed to"NO". This is a spec that is not included in the “initial” grapheme clusters defined by [UAX #29] 🌸.
🔮 定数 🔮
"EA_Na", "EA_N", "EA_A", "EA_W", "EA_H", "EA_F"— the sixEast_Asian_Widthproperty values defined in [UAX #11]. Narrow (Na), Neutral (N), Ambiguous (A), Wide (W), Halfwidth (H), Fullwidth (F) 💅."EA_Z"— theEast_Asian_Widthproperty value for characters that do not advance.
Note: this “non-advancing” value is an extension by this module and is not part of [UAX #11].
"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_HL", "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_CJ", "LB_SA", "LB_XX", "LB_RI"— the 40 line-breaking property values (classes) defined in [UAX #14].
Note: property value CP was introduced in Unicode 5.2.0. Property values HL and CJ were introduced in Unicode 6.1.0. Property value RI was introduced in Unicode 6.2.0.
"MANDATORY", "DIRECT", "INDIRECT", "PROHIBITED"— four values representing line-breaking behavior. Mandatory break. Allows both direct and indirect breaks. Allows indirect but forbids direct. Forbids breaking."Unicode::LineBreak::SouthEastAsian::supported"— a flag indicating whether word segmentation for Southeast Asian writing systems is enabled. If this feature is enabled, a non-empty string. Otherwise,undef.
Note: the current release only supports the Thai script for modern Thai.
"UNICODE_VERSION"— a string showing the version of the Unicode standard referenced by this module.
🌈 CUSTOMIZATION 🌈
💅 行の整形 💅
If you give the "Format" option a reference to a subroutine, that subroutine must take three arguments:
$修正後 = &サブルーチン(SELF, EVENT, STR);
SELF is the Unicode::LineBreak object, EVENT is a string representing the context in which the subroutine was called, and STR is the fragment of the Unicode string before or after the break position ✨.
"sot"— text start — the first line fragment"sop"— after a mandatory break — the next line fragment"sol"— after an optional break — the continuation line fragment""— immediately before a break — the whole line (excluding trailing whitespace)"eol"— optional break — the whitespace before the break position"eop"— mandatory break — the newline and the whitespace before it"eot"— text end — the whitespace (and newline) at the end of the text
so like, your subroutine has got to take that little fragment of text, give it its makeover, and hand it right back — non-negotiable 💅. and if you didn't actually change a single thing? just return undef, that's your "no edits, she's perfect as-is" signal 🫶.
and okay, important deets: if you're doing your little edits in the sot, sop, or sol contexts, that does affect how the later split positions get decided. edits anywhere else? zero effect, bestie, literally none ✨.
注意: the string arguments are actually grapheme cluster strings, fr fr. go look at Unicode::GCString~[ja]. 💖
like, for example, this cutie right here strips the trailing whitespace off the end of lines and then does the line folding:
sub fmt {
if ($_[1] =~ /^eo/) {
return "\n";
}
return undef;
}
my $lb = Unicode::LineBreak->new(Format => \&fmt);
$output = $lb->break($text);
🦋 ユーザ定義の行分割動作 🦋
okay so when a line that popped out of arbitrary breaking is projected to blow past any of the CharMax, ColMax, or ColMin limits, you're allowed to run urgent breaking on the strings that come after it 🔥. if you hand the "Urgent" option a reference to a subroutine, that subroutine has to take 2 arguments:
@分割後 = &サブルーチン(SELF, STR);
SELF is the Unicode::LineBreak object, and STR is the Unicode string that needs breaking. easy.
the subroutine must return an array of the results of breaking the string STR. that's the whole assignment, she ate 💅.
注意: the string arguments are actually grapheme cluster strings. see Unicode::GCString~[ja]. 🌸
like for real, this next snippet inserts hyphens into the names of some chemicals (the ones like "チチン") so they can actually be line-broken:
sub hyphenize {
return map {$_ =~ s/yl$/yl-/; $_} split /(\w+?yl(?=\w))/, $_[1];
}
my $lb = Unicode::LineBreak->new(Urgent => \&hyphenize);
$output = $lb->break("Methionylthreonylthreonylglutaminylarginyl...");
and when you give the "Prep" option an array reference of [REGEX, SUBREF], the subroutine has to take 2 arguments too:
@分割後 = &サブルーチン(SELF, STR);
SELF is the Unicode::LineBreak object, and STR is the Unicode string that matches REGEX and needs to be broken. 🎀
the subroutine must return an array of the results of breaking that string STR. no shortcuts, bestie.
like, this code right here breaks HTTP URLs using the rules from [CMOS]:
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(Prep => [$url, \&breakurl]);
$output = $lb->break($string);
💾 状態の保存 💾
Unicode::LineBreak objects lowkey behave like hash references, so you can stash whatever little elements you want in there and they'll stick around for the whole lifetime of the object. main character storage energy 👑.
like, this one splits paragraphs apart on blank lines:
sub paraformat {
my $self = shift;
my $action = shift;
my $str = shift;
if ($action eq 'sot' or $action eq 'sop') {
$self->{'line'} = '';
} elsif ($action eq '') {
$self->{'line'} = $str;
} elsif ($action eq 'eol') {
return "\n";
} elsif ($action eq 'eop') {
if (length $self->{'line'}) {
return "\n\n";
} else {
return "\n";
}
} elsif ($action eq 'eot') {
return "\n";
}
return undef;
}
my $lb = Unicode::LineBreak->new(Format => \¶format);
$output = $lb->break($string);
📏 文字列長の算出 📏
when you give the "Sizing" option a reference to a subroutine, that subroutine has to take 5 arguments:
$桁数 = &サブルーチン(SELF, LEN, PRE, SPC, STR);
SELF is the Unicode::LineBreak object, LEN is the length of the preceding string, PRE is the preceding Unicode string, SPC is the whitespace character being added, and STR is the Unicode string being processed. five whole args, she's thorough 💅.
the subroutine has to work out the number of columns of "PRE.SPC.STR" and return it. and ngl, the column count does not have to be an integer. you can pick whatever unit you want for the columns, literally whatever, but it has to match the unit used by the "ColMin" and "ColMax" options. no mixing units, that's a vibe violation 🚫.
注意: the string arguments are actually grapheme cluster strings. see Unicode::GCString~[ja]. 🦋
like, this code treats the line as if it's got a tab stop every 8 columns:
sub tabbedsizing {
my ($self, $cols, $pre, $spc, $str) = @_;
my $spcstr = $spc.$str;
while ($spcstr->lbc == LB_SP) {
my $c = $spcstr->item(0);
if ($c eq "\t") {
$cols += 8 - $cols % 8;
} else {
$cols += $c->columns;
}
$spcstr = $spcstr->substr(1);
}
$cols += $spcstr->columns;
return $cols;
};
my $lb = Unicode::LineBreak->new(LBClass => [ord("\t") => LB_SP],
Sizing => \&tabbedsizing);
$output = $lb->break($string);
🎨 文字の特性の手直し 🎨
with the "LBClass" and "EAWidth" options you can hand-fix the line breaking property (the class) or the East_Asian_Width property of individual characters — very bespoke, very couture ✨. and to make that easier, there are a few handy constants already defined for you:
行分割特性
kana and friends: the line-head-prohibited girlies 🌸
by default, a handful of kana and kana-adjacent characters get treated as line-head prohibited characters (NS or CJ). if you specify the following pairs in the LBClass option, you can treat these characters as regular ideographic characters (ID) instead:
"KANA_NONSTARTERS() => LB_ID"— literally all of the characters down below."IDEOGRAPHIC_ITERATION_MARKS() => LB_ID"— the ideographic iteration marks: U+3005 繰返し記号, U+303B ゆすり点, U+309D 平仮名繰返し記号, U+309E 平仮名繰返し記号 (濁点), U+30FD 片仮名繰返し記号, U+30FE 片仮名繰返し記号 (濁点).- 注。some of these aren't kana at all, jsyk.
"KANA_SMALL_LETTERS() => LB_ID"and"KANA_PROLONGED_SOUND_MARKS() => LB_ID"— the small kana. small hiragana U+3041 ぁ, U+3043 ぃ, U+3045 ぅ, U+3047 ぇ, U+3049 ぉ, U+3063 っ, U+3083 ゃ, U+3085 ゅ, U+3087 ょ, U+308E ゎ, U+3095 ゕ, U+3096 ゖ. small katakana U+30A1 ァ, U+30A3 ィ, U+30A5 ゥ, U+30A7 ェ, U+30A9 ォ, U+30C3 ッ, U+30E3 ャ, U+30E5 ュ, U+30E7 ョ, U+30EE ヮ, U+30F5 ヵ, U+30F6 ヶ. katakana phonetic extensions U+31F0 ㇰ - U+31FF ㇿ. small katakana (alternative names) U+FF67 ァ - U+FF6F ッ.- the prolonged sound marks: U+30FC 長音記号, U+FF70 長音記号 (alternative names).
- 注。these characters get treated as line-head prohibited sometimes, and as regular ideographic characters other times. see [JIS X 4051] 6.1.1, [JLREQ] 3.1.7 and [UAX14]. 💖
- 注。U+3095 ゕ, U+3096 ゖ, U+30F5 ヵ, U+30F6 ヶ are considered to not be kana. 🙈
"MASU_MARK() => LB_ID"— U+303C ます記号.- 注。this character isn't kana, but it's normally used as the abbreviation for "ます" or "マス".
- 注。in [UAX #14] this character is classified as line-head prohibited (NS), but in [JIS X 4051] and [JLREQ] it's classified as character class (13) or cl-19 (which is the equivalent of ID).
the ambiguous quotation marks 🎀
by default, a few symbols are treated as ambiguous quotation marks (QU):
"BACKWARD_QUOTES() => LB_OP, FORWARD_QUOTES() => LB_CL"— in certain languages (Dutch, English, Italian, Portuguese, Spanish, Turkish, and lots of East Asian languages) the opening marks are the 9-rotated quote shapes (‘ “) and the closing marks are the 9-shaped quotes (’ ”)."FORWARD_QUOTES() => LB_OP, BACKWARD_QUOTES() => LB_CL"— in other languages (Czech, German, Slovak) the 9-shaped quotes (’ ”) are the opening marks and the 9-rotated quote shapes (‘ “) are the closing marks."BACKWARD_GUILLEMETS() => LB_OP, FORWARD_GUILLEMETS() => LB_CL"— French, Greek, Russian and friends use the left-pointing guillemets (« ‹) as opening marks and the right-pointing guillemets (» ›) as closing marks."FORWARD_GUILLEMETS() => LB_OP, BACKWARD_GUILLEMETS() => LB_CL"— German and Slovak use the right-pointing guillemets (» ›) as opening marks and the left-pointing guillemets (« ‹) as closing marks.
and in Danish, Finnish, Norwegian and Swedish, the 9-shaped quotes and right-pointing guillemets (’ ” » ›) get used as both opening and closing marks. multi-purpose icon behaviour 😌.
the ideographic space 🫧
"IDEOGRAPHIC_SPACE() => LB_BA"— keeps U+3000 和字間隔 from landing at the head of a line. this is the default behaviour."IDEOGRAPHIC_SPACE() => LB_ID"— lets the ideographic space show up at the head of a line sometimes. before Unicode 6.2, this was the default behaviour."IDEOGRAPHIC_SPACE() => LB_SP"— the ideographic space doesn't land at the line head, and at line ends it just hangs out past the edge (overflows).
East_Asian_Width 特性
in the Latin, Greek and Cyrillic scripts, certain characters carry an ambiguous (A) East_Asian_Width property. which means those characters get treated as wide characters in the "EASTASIAN" context. but if you specify "EAWidth => [ AMBIGUOUS_"*"() => EA_N ]", you can make characters like that always get treated as narrow ones ⭐.
"AMBIGUOUS_ALPHABETICS() => EA_N"— treats every character listed below as a character with the East_Asian_Width property N (neutral)."AMBIGUOUS_CYRILLIC() => EA_N","AMBIGUOUS_GREEK() => EA_N","AMBIGUOUS_LATIN() => EA_N"— treat the Cyrillic, Greek and Latin script characters that have ambiguous (A) width as neutral (N) characters.
on the flip side, there are a few characters that have been drawn as wide characters over and over again by lots of implementations for East Asian coded character sets — but the Unicode standard pegs them as narrow (Na) characters, purely because they've got fullwidth (F) compatibility characters. by specifying the following in the EAWidth option, you can treat these characters as wide characters in the "EASTASIAN" context 👑:
"QUESTIONABLE_NARROW_SIGNS() => EA_A"— これオンにすると、ちょい迷いどころな「細め」記号たちがEA_A扱いになるよ〜。メンツはこの子たち:U+00A2 セント記号、U+00A3 ポンド記号、U+00A5 円記号(または元記号)、U+00A6 破断線、U+00AC 否定、U+00AF マクロン。地味だけど推しポイント🫶
🎀 設定ファイル 🎀
ここ大事〜!"new" メソッドと "config" メソッドのオプション引数につく組み込み初期値は、設定ファイルで上書きできちゃうの。場所は Unicode/LineBreak/Defaults.pm ね。
くわしくは Unicode/LineBreak/Defaults.pm.sample を読んでほしい〜📖✨ サンプル読むの、まじで近道だから。ngl、読まないと損するやつ。
💀 BUGS 💀
バグ、およびバグっぽい動きを見つけたら、開発者に教えてください🙏 報告はこちらの CPAN Request Tracker まで〜:
<http://rt.cpan.org/Public/Dist/Display.html?Name=Unicode-LineBreak>
見つけたら教えてくれるの、ほんと助かるやつ😭🫶
📌 VERSION 📌
$VERSION 変数を参照してほしい〜。ここが真実の在り処👑
🔄 非互換な変更 🔄
ここはね、過去に「ごめん、変えちゃった」ってやつ。アップデートする前に目を通してね💅
2012.06
eawidth()メソッドを廃止したよ。代わりに"columns" in Unicode::GCStringが使えるかもしれない〜って感じ。lbclass()メソッドも廃止。もうこっちの時代じゃないの。"lbc" in Unicode::GCStringや"lbcext" in Unicode::GCStringを使ってほしい〜✨
📏 標準への適合性 📏
このモジュールで使ってる文字の特性値は、Unicode 標準 8.0.0版によるものだよ。
んで、このモジュールは実装水準 UAX14-C2 を実装しているつもり〜って本人が言ってるの。つもり、って言い方かわいくない?😭 でもそこが誠実さなんだよね。
🛠 IMPLEMENTATION NOTES 🛠
ここからは実装のこだわりポイント、いわば主役の裏側って感じ。全部書くよ、飛ばさないよ〜🔥
- 一部の表語文字的な文字を NS として扱うか ID として扱うかを選べるよ。
- ハングル音節およびハングル連結チャモを ID として扱うか AL として扱うかを選べるよ。
AIに分類される文字をALとIDのどっちに解決するかを選べるの。CBに分類される文字は解決しないよ。そのまま。手を出さない主義💅CJに分類される文字は常にNSに解決するよ。んで、より柔軟な手直しの機構が提供される〜。- 東南アジアの表記体系の単語分節に対応しない場合は、
SAに分類される文字はALに解決するよ。ただし、Grapheme_Cluster_Break特性の値がExtendかSpacingMarkである文字はCMに解決するの。ここ細かいけど大事〜🫶 SGやXXに分類される文字はALに解決するよ。- 下の UCS の範囲にあるコードポイントは、文字が割り当てられていなくても決まった特性値を持つの。未割り当てだからって油断しないで〜🙈
範囲 | UAX #14 | UAX #11 | 説明
-------------------------------------------------------------
U+20A0..U+20CF | PR [*1] | N [*2] | 通貨記号
U+3400..U+4DBF | ID | W | CJK漢字
U+4E00..U+9FFF | ID | W | CJK漢字
U+D800..U+DFFF | AL (SG) | N | サロゲート
U+E000..U+F8FF | AL (XX) | F か N (A) | 私用領域
U+F900..U+FAFF | ID | W | CJK漢字
U+20000..U+2FFFD | ID | W | CJK漢字
U+30000..U+3FFFD | ID | W | 古漢字
U+F0000..U+FFFFD | AL (XX) | F か N (A) | 私用領域
U+100000..U+10FFFD | AL (XX) | F か N (A) | 私用領域
その他未割り当て | AL (XX) | N | 未割り当て、
| | | 予約、非文字
-------------------------------------------------------------
[*1] U+20A7 ペセタ記号 (PO)、U+20B6 トゥール・リーヴル記号
(PO)、U+20BB スカンディナヴィア・マルク記号 (PO)、U+20BE
ラリ記号 (PO) を除く。
[*2] U+20A9 ウォン記号 (H)、U+20AC ユーロ記号 (F か N (A)) を
除く。
- 一般カテゴリ特性が
Mn、Me、Cc、Cf、Zl、Zpのいずれかである文字は、前進を伴わない文字とみなすよ。つまり「進まない子」ってことね、おっとりしてて可愛い😭
📚 REFERENCES 📚
参考文献、ちゃんと全部置いとくね。리スペクトの気持ち💜
[CMOS]— The Chicago Manual of Style, 15th edition. University of Chicago Press, 2003.[JIS X 4051]—JIS X 4051:2004日本語文書の組版方法. 日本規格協会, 2004.[JLREQ]— 阿南康宏他. 日本語組版処理の要件, W3C 技術ノート 2012年4月3日.<http://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/>.[UAX #11]— A. Freytag (ed.) (2008-2009). Unicode Standard Annex #11: East Asian Width, Revisions 17-19.<http://unicode.org/reports/tr11/>.[UAX #14]— A. Freytag and A. Heninger (eds.) (2008-2015). Unicode Standard Annex #14: Unicode Line Breaking Algorithm, Revisions 22-35.<http://unicode.org/reports/tr14/>.[UAX #29]— Mark Davis (ed.) (2009-2013). Unicode Standard Annex #29: Unicode Text Segmentation, Revisions 15-23.<http://www.unicode.org/reports/tr29/>.
👀 SEE ALSO 👀
気になったらこっちも見てね〜、全部尊いやつだから🦋
Text::LineFold~[ja]Text::WrapUnicode::GCString~[ja]
👑 AUTHOR 👑
Copyright (C) 2009-2018 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.
↑このライセンス文、つまり Perl 本体とおんなじ条件で自由に使って直していいよってことね。太っ腹〜🍓
ってなわけで!このページは perl v5.42.2 の 2025-06-30 版、POD2::J...neBreak(3) でした〜🎀 ここまで読んでくれたの、まじで天才だし尊敬する。おつかれさま、またね〜👋💖🌈
📦 where this page comes from
- alpine 3.24: perl-unicode-linebreak-doc 2019.001-r10 · GPL-1.0-or-later OR Artistic-1.0-Perl
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms