Server IP : 111.118.215.189 / Your IP : 216.73.216.162 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /proc/thread-self/root/opt/wp/plugins/jetpack/vendor/wikimedia/aho-corasick/bench/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php require_once __DIR__ . '/../src/MultiStringMatcher.php'; require_once __DIR__ . '/../src/MultiStringReplacer.php'; use AhoCorasick\MultiStringReplacer; if ( !file_exists( __DIR__ . '/23835-0.txt' ) ) { die( 'Please download http://www.gutenberg.org/files/23835/23835-0.txt' ); } if ( !file_exists( __DIR__ . '/ZhConversion.php' ) ) { die( 'You need ZhConversion.php, from http://git.io/vIMst' ); } require_once __DIR__ . '/ZhConversion.php'; $text = file_get_contents( __DIR__ . '/23835-0.txt' ); $status = 0; $expected = strtr( $text, $zh2Hant ); echo "MultiStringReplacer::searchAndReplace(): "; $replacer = new MultiStringReplacer( $zh2Hant ); if ( $replacer->searchAndReplace( $text ) !== $expected ) { echo "ERROR\n"; $status = 1; } else { echo "OK\n"; } if ( function_exists( 'fss_exec_replace' ) ) { echo "fss_exec_replace(): "; $fss = fss_prep_replace( $zh2Hant ); if ( fss_exec_replace( $fss, $text ) !== $expected ) { echo "ERROR\n"; $status = 1; } else { echo "OK\n"; } } exit( $status );