<commit_before><?php

//include __DIR__ . '../vendor/autoload.php';
include __DIR__ . '/../src/Overtrue/Pinyin.php';

use Overtrue\Pinyin;

class TestCase extends PHPUnit_Framework_TestCase
{
    protected $pinyin;

    public function setUp()
    {
        # code...
    }

    // test delimiter
    public function testDelimiter()
    {
        $this->assertEquals('nín hǎo', Pinyin::pinyin('您好'));
    }

    // test temporary changes delimiter
    public function testTemporaryDelimiter()
    {
        $this->assertEquals('nín-hǎo', Pinyin::pinyin('您好', array('delimiter' => '-')));
        Pinyin::set('delimiter', '*');
        $this->assertEquals('nín*hǎo', Pinyin::pinyin('您好'));
        $this->assertEquals('nín hǎo', Pinyin::pinyin('您好'));
    }

    // test get first letter
    public function testLetters()
    {
        $this->assertEquals('N H', Pinyin::letter('您好'));
        $this->assertEquals('N-H', Pinyin::letter('您好', '-'));
        $this->assertEquals('NH', Pinyin::letter('您好', ''));
        $this->assertEquals('KXLL', Pinyin::letter('康熙来了', ''));
        $this->assertEquals('D Z X W Q L X B D D Z D G M H', Pinyin::letter('带着希望去旅行，比到达终点更美好'));
        $this->assertEquals('Z Q S L Z W Z W', Pinyin::letter('赵钱孙李 周吴郑王'));
    }

    // test return with tone
    public function testResultWithTone()
    {
        $this->assertEquals('dài zhe xī wàng qù lǚ xíng , bǐ dào dá zhōng diǎn gèng měi hǎo', Pinyin::pinyin('带着希望去旅行，比到达终点更美好'));
    }

    // test without tone
    public function testResultWithoutTone()
    {
        $this->assertEquals('dai zhe xi wang qu lu xing , bi dao da zhong dian geng mei hao', Pinyin::pinyin('带着希望去旅行，比到达终点更美好', array('accent' => false)));<commit_msg>修改测试用例<commit_after><?php

//include __DIR__ . '../vendor/autoload.php';
include __DIR__ . '/../src/Overtrue/Pinyin.php';

use Overtrue\Pinyin;

class TestCase extends PHPUnit_Framework_TestCase
{
    protected $pinyin;

    public function setUp()
    {
        # code...
    }

    // test delimiter
    public function testDelimiter()
    {
        $this->assertEquals('nín hǎo', Pinyin::pinyin('您好'));
    }

    // test temporary changes delimiter
    public function testTemporaryDelimiter()
    {
        $this->assertEquals('nín-hǎo', Pinyin::pinyin('您好', array('delimiter' => '-')));
        Pinyin::set('delimiter', '*');
        $this->assertEquals('nín*hǎo', Pinyin::pinyin('您好'));
        $this->assertEquals('nín hǎo', Pinyin::pinyin('您好'));
        Pinyin::set('delimiter', ' ');
    }

    // test get first letter
    public function testLetters()
    {
        $this->assertEquals('N H', Pinyin::letter('您好'));
        $this->assertEquals('N-H', Pinyin::letter('您好', '-'));
        $this->assertEquals('NH', Pinyin::letter('您好', ''));
        $this->assertEquals('KXLL', Pinyin::letter('康熙来了', ''));
        $this->assertEquals('D Z X W Q L X B D D Z D G M H', Pinyin::letter('带着希望去旅行，比到达终点更美好'));
        $this->assertEquals('Z Q S L Z W Z W', Pinyin::letter('赵钱孙李 周吴郑王'));
    }

    // test return with tone
    public function testResultWithTone()
    {
        $this->assertEquals('dài zhe xī wàng qù lǚ xíng , bǐ dào dá zhōng diǎn gèng měi hǎo', Pinyin::pinyin('带着希望去旅行，比到达终点更美好'));
    }

    // test without tone
    public function testResultWithoutTone()
    {
        $this->assertEquals('dai zhe xi wang qu lu xing , bi dao da zhong dian geng mei hao', Pinyin::pinyin('带着希望去旅行，比到达终点更美好', array('accent' => false)));
{'fraction_non_alphanumeric': 0.1735106998264893, 'fraction_numerical': 0.0, 'mean_word_length': 3.0694117647058823, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4182857', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1380, 'n_words': 264}