mirror of
https://github.com/symfony/ai.git
synced 2026-03-23 23:42:18 +01:00
24 lines
628 B
PHP
24 lines
628 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Symfony package.
|
|
*
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
use Symfony\AI\Store\Document\Loader\TextFileLoader;
|
|
use Symfony\AI\Store\Document\Transformer\TextSplitTransformer;
|
|
|
|
require_once dirname(__DIR__).'/bootstrap.php';
|
|
|
|
$loader = new TextFileLoader();
|
|
$splitter = new TextSplitTransformer();
|
|
$source = dirname(__DIR__, 2).'/fixtures/lorem.txt';
|
|
|
|
$documents = iterator_to_array($splitter->transform($loader->load($source)));
|
|
|
|
dump($documents);
|