Skip to content

thettwe/myparser-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

MyanmarParser-PHP

PHP version of https://github.com/thanlwinsoft/MyanmarParser

Porting Directly from Python Version https://github.com/thantthet/MyanmarParser-Py

Minimum PHP 5.6 required.

Usage

function println($text)
{
	$newline = (PHP_SAPI === 'cli') ? PHP_EOL : '<br/>';

	print $text . $newline;
}

$m = new MyParser();
$str = 'ဘီးကျဲတွေ ခေတ်ကုန်သွားပြီ';

//ဘီး
//ကျဲ
//တွေ

//ခေတ်
//ကုန်
//သွား
//ပြီ

$offset = 0;

while ($offset < mb_strlen($str)) {
	list($breaktype, $next_offset) = $m->get_next_syllable($str, mb_strlen($str), $offset); # parse
	println(mb_substr($str, $offset, $next_offset - $offset));
    $offset = $next_offset;
}

About

PHP version of MyanmarParser to breakdown Burmese Syllable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages