https://github.com/kjdev/budoux
BudouX for PHP
https://github.com/kjdev/budoux
Last synced: 10 months ago
JSON representation
BudouX for PHP
- Host: GitHub
- URL: https://github.com/kjdev/budoux
- Owner: kjdev
- License: apache-2.0
- Created: 2021-11-19T03:16:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-19T03:31:34.000Z (about 4 years ago)
- Last Synced: 2025-02-09T06:44:15.850Z (about 1 year ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
BudouX for PHP
==============
[BudouX][] PHP implementation.
[BudouX][] is the machine learning powered line break organizer tool.
[BudouX]: https://github.com/google/budoux.git
Usage
-----
You can get a list of phrases by feeding a sentence to the parser.
``` php
use BudouX\Parser;
$parser = Parser::loadDefaultJapanese();
print_r($parser->parse('今日は天気です。'));
// Array
// (
// [0] => 今日は
// [1] => 天気です。
// )
```
If you have a custom model, you can use it as follows.
``` php
use BudouX\Parser;
$model = json_decode(file_get_contents('/path/to/your/model.json'), true);
$parser = new Parser($model);
```