kaungkhantjc/myanmar-wikipedia-faker

A high-performance Myanmar (Burmese) text generator based on the DatarrX Wikipedia Dataset.

Maintainers

Package info

github.com/kaungkhantjc/myanmar-wikipedia-faker

pkg:composer/kaungkhantjc/myanmar-wikipedia-faker

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.2 2026-08-03 02:19 UTC

This package is auto-updated.

Last update: 2026-08-03 02:20:19 UTC


README

Social Card

Myanmar Wikipedia Faker

Run Tests Latest Stable Version Total Downloads

A high-performance Myanmar (Burmese) text generator. Requires PHP 8.4+. It provides a Faker provider built from the DatarrX Myanmar Wikipedia dataset and uses a binary byte-offset map index for true $O(1)$ time complexity, $O(1)$ memory usage, and instant random access.

Quick install

composer require kaungkhantjc/myanmar-wikipedia-faker

Usage (plain PHP)

$faker = \Faker\Factory::create();
$faker->addProvider(new \Kaungkhantjc\Faker\MyanmarWikipediaTextProvider($faker));
echo $faker->myanmarWikipediaText();

Laravel integration

  • Install package:

    composer require kaungkhantjc/myanmar-wikipedia-faker --dev
  • Create and register the provider for Laravel's Faker globally.

    # In Laravel 13, providers are automatically registered to the bootstrap/providers.php when created via the Artisan CLI
    php artisan make:provider FakerServiceProvider
  • Add the following code to the register method of the newly created FakerServiceProvider:

    if (!app()->environment(['local', 'testing'])) return;
    $this->app->afterResolving(\Faker\Generator::class, function (\Faker\Generator $faker) {
        $faker->addProvider(new \Kaungkhantjc\Faker\MyanmarWikipediaTextProvider($faker));
    });;

After this, fake()->myanmarWikipediaText() will be available in tinker, factories, seeders and tests.

Rebuilding Dataset from Source (for contributors)

If you need to rebuild the .gz dataset from Hugging Face:

  1. Create and activate a virtual environment:

     python -m venv .venv
     source .venv/bin/activate # On Windows: .venv\Scripts\Activate.ps1
  2. Install dependencies and run build script:

    pip install pyarrow
    python scripts/build_dataset.py

When finished, deactivate with deactivate.

The script downloads and caches resources/data.parquet locally and streams memory-efficient row batches into compressed native files (myanmar_sentences.txt.gz, offsets.bin.gz, and line_count.txt).

Testing

composer test

Credits

Dataset: Myanmar Wikipedia Dataset (20260501) by Khant Sint Heinn (DatarrX) — released under CC-BY-4.0.

License

This project is licensed under the MIT License. See the LICENSE file for details.