MediaWiki master
LanguageZh Class Reference

Chinese-specific code. More...

Inherits LanguageZh_hans.

Inherited by LanguageGan, and LanguageWuu.

Collaboration diagram for LanguageZh:

Public Member Functions

 convertForSearchResult ( $termsArray)
 
 segmentForDiff ( $text)
 Add a formfeed character between each non-ASCII character, so that "word-level" diffs will effectively operate on a character level.
 
 unsegmentForDiff ( $text)
 
- Public Member Functions inherited from LanguageZh_hans
 formatDuration ( $seconds, array $chosenIntervals=[])
 
 hasWordBreaks ()
 
 normalizeForSearch ( $s)
 
 segmentByWord ( $string)
 

Protected Member Functions

 getSearchIndexVariant ()
 

Detailed Description

Chinese-specific code.

This handles both Traditional and Simplified Chinese. Right now, we distinguish zh_hans, zh_hant, zh_cn, zh_tw, zh_sg, and zh_hk.

Definition at line 30 of file LanguageZh.php.

Member Function Documentation

◆ convertForSearchResult()

LanguageZh::convertForSearchResult ( $termsArray)

Definition at line 58 of file LanguageZh.php.

◆ getSearchIndexVariant()

LanguageZh::getSearchIndexVariant ( )
protected

Reimplemented in LanguageGan, and LanguageWuu.

Definition at line 54 of file LanguageZh.php.

◆ segmentForDiff()

LanguageZh::segmentForDiff ( $text)

Add a formfeed character between each non-ASCII character, so that "word-level" diffs will effectively operate on a character level.

The FF characters are stripped out by unsegmentForDiff().

We use FF because it is the least used character that is matched by PCRE's \s class.

In the unlikely event that an FF character appears in the input, it will be displayed in the diff as a replacement character.

Parameters
string$text
Returns
string

Definition at line 45 of file LanguageZh.php.

◆ unsegmentForDiff()

LanguageZh::unsegmentForDiff ( $text)

Definition at line 50 of file LanguageZh.php.


The documentation for this class was generated from the following file: