transliteration - Where can I find a list of IDs or rules for the PHP transliterator (Intl)? -
transliterator::listids()
list ids, apparently it's not complete list.
in example page, id looks like:
any-latin; nfd; [:nonspacing mark:] remove; nfc; [:punctuation:] remove; lower();
which kind of weird, because ids supposed unique. looks more rule, doesn't work if pass createfromrules
method :)
anyway, i'm trying remove punctuation string, except dash (-
), or characters specific list.
do know if that's possible? or there documentation better explains syntax transliterator ?
the ids transliterator::listids()
"basic ids". example gave "compound id". can see icu docs on this.
you can create own rules transliterator::createfromrules()
.
you can take @ prefefined rules (replace 48 icu version):
<?php $a = new resourcebundle(null, 'icudt48l-translit', true); foreach ($a['rulebasedtransliteratorids'] $name => $v) { $file = @$v['file']; if (!$file) { $file = $v['internal']; echo $name, " (direction $file[direction]; internal)\n"; } else { echo $name, " (direction: $file[direction])\n"; echo $file['resource']; } echo "\n--------------\n"; }
after formatting, result looks this.
Comments
Post a Comment