wijourdil/php-simple-furiganizer

There is no license information available for the latest version (1.0.0) of this package.

A simple PHP package to generate japanese text with furigana for a given word and reading.

1.0.0 2024-05-23 12:42 UTC

This package is auto-updated.

Last update: 2024-05-23 13:09:58 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This package is a simple tool to generate japanese text with furigana for a given word and reading.

雨の日(Text) + あめのひ(Reading) ⇒ 雨(あめ)の日(ひ)

Installation

Install the package via composer:

composer require wijourdil/php-simple-furiganizer

Usage

First, simply import the Furiganizer class:

use Wijourdil\PhpSimpleFuriganizer\Furiganizer;

Then, you just have to instantiate a new Furiganizer and generate the output in the format you want:

$furiganizer = new Furiganizer('雨の日', 'あめのひ');

echo "Output in text is " . $furiganizer->toBrackets();
echo "Output in HTML is " . $furiganizer->toHtml();

Will output :

Output in text is 雨[あめ]の 日[ひ]
Output in HTML is 雨(あめ)の日(ひ)