Ec (2); functionSplitRMM ($ str & quot;) {& nbsp; if ($ str! & Quot;) $ this-& gt; SetSource (trim ($ str); & nbsp; if ($ this-& gt; SourceString & quot; & quot;) return & quot; & nbsp; script ec (2); script
Function SplitRMM ($ str = ""){
If ($ str! = "") $ This-> SetSource (trim ($ str ));
If ($ this-> SourceString = "") return "";
// Rough text
$ This-> SourceString = $ this-> ReviseString ($ this-> SourceString );
// Separate specific text
$ Spwords = explode ("", $ this-> SourceString );
$ SpLen = count ($ spwords );
$ Spc = $ this-> SplitChar;
For ($ I = ($ spLen-1); $ I> = 0; $ I --){
If (trim ($ spwords [$ I]) = "") continue;
If ($ this-> NotGBK ($ spwords [$ I]) {
If (ereg ("[^ 0-9. +-]", $ spwords [$ I])
{$ This-> ResultString = $ spwords [$ I]. $ spc. $ this-> ResultString ;}
Else
{
$ Nextword = "";
@ $ Nextword = substr ($ this-> ResultString, 0, strpos ($ this-> ResultString ,""));
If (ereg ("^". $ this-> CommonUnit, $ nextword )){
$ This-> ResultString = $ spwords [$ I]. $ this-> ResultString;
} Else {
$ This-> ResultString = $ spwords [$ I]. $ spc. $ this-> ResultString;
}
}
}
Else
{
$ C = $ spwords [$ I] [0]. $ spwords [$ I] [1];
$ N = hexdec (bin2hex ($ c ));
If ($ c = "" ") // name of the book
{$ This-> ResultString = $ spwords [$ I]. $ spc. $ this-> ResultString ;}
Else if ($ n> 0xA13F & $ n <0xAA40) // punctuation
{$ This-> ResultString = $ spwords [$ I]. $ spc. $ this-> ResultString ;}
Else // normal short sentence
{
If (strlen ($ spwords [$ I]) <= $ this-> SplitLen)
{
// If the Terminator is a special delimiter, separate it.
If (ereg ($ this-> EspecialChar. "$", $ spwords [$ I], $ regs )){
$ Spwords [$ I] = ereg_replace ($ regs [0]. "$", "", $ spwords [$ I]). $ spc. $ regs [0];
}
// Whether it is a common unit
If (! Ereg ("^". $ this-> CommonUnit, $ spwords [$ I]) | $ I = 0 ){
$ This-> ResultString = $ spwords [$ I]. $ spc. $ this-> ResultString;
} Else {
$ This-> ResultString = $ spwords [$ I-1]. $ spwords [$ I]. $ spc. $ this-> ResultString;
$ I --;
}
}
Else
{
$ This-> ResultString = $ this-> RunRMM ($ spwords [$ I]). $ spc. $ this-> ResultString;
}
}
}
}
Return $ this-> ResultString;
}