<?php
class 	initcws{


public function cws($str){
// 严格开发模式
ini_set('display_errors', 'On');
ini_set('memory_limit', '64M');
error_reporting(E_ALL);
//加载类库
require_once 'phpanalysis.class.php';


$do_fork = $do_unit = true;

    //初始化类
    PhpAnalysis::$loadInit = false;
    $pa = new PhpAnalysis('utf-8', 'utf-8', $pri_dict);

    
    //载入词典
    $pa->LoadDict();
        
    //执行分词
    $pa->SetSource($str);
    $pa->differMax = $do_multi;
    $pa->unitWord = $do_unit;
    
    $pa->StartAnalysis( $do_fork );

    
    $okresult = $pa->GetFinallyResult('#', $do_prop);

    
    $pa_foundWordStr = $pa->foundWordStr;
    

    
    $slen = strlen($str);
    $slen = sprintf('%0.2f', $slen/1024);
    
    $pa = '';
	
	
	
		return $okresult ;
	}
	
	
	}