PHP code example of crazywhalecc / time-nlp

1. Go to this page and download the library: Download crazywhalecc/time-nlp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

crazywhalecc / time-nlp example snippets

bash
php test.php
php test.php --debug
# debug模式会sleep等待显示解析过程

>>> 明天上午
<<< {"type":"timestamp","timestamp":"2019-08-14 10:00:00"}

>>> 明天上午11点叫我起床
<<< {"type":"timestamp","timestamp":"2019-08-14 11:00:00"}

......更多示例可参考Python和Java版