| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 62 | public function tokenize( $string ) { |
||
| 63 | |||
| 64 | if ( $this->tokenizer !== null ) { |
||
| 65 | $string = implode( " ", $this->tokenizer->tokenize( $string ) ); |
||
| 66 | } |
||
| 67 | |||
| 68 | // Filter is based on https://github.com/kitech/cms-drupal/blob/master/modules/csplitter/filter.txt |
||
| 69 | $pattern = str_replace( |
||
| 70 | $this->patternExemption, |
||
| 71 | '', |
||
| 72 | '([\s\、,,。/?《》〈〉;:“”"〃'`[]{}\|~!-=_+)(()*…—─%¥…◆★◇□■【】#·啊吧把并被才从的得当对但到地而该过个给还和叫将就可来了啦里没你您哪那呢去却让使是时省随他我为现县向像象要由矣已以也又与于在之这则最乃\/\(\)\[\]{}<>\r\n"]|(?<!\d)\.(?!\d))' |
||
| 73 | ); |
||
| 74 | |||
| 75 | $result = preg_split( '/' . $pattern . '/u', $string, null, PREG_SPLIT_NO_EMPTY ); |
||
| 76 | |||
| 77 | if ( $result !== false ) { |
||
| 78 | return $result; |
||
| 79 | } |
||
| 80 | |||
| 81 | return array(); |
||
| 82 | } |
||
| 83 | |||
| 85 |