|
|
|
@ -15,15 +15,18 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
|
|
|
|
*/
|
|
|
|
|
package gplx.xowa.addons.wikis.ctgs.enums; import gplx.*; import gplx.xowa.*; import gplx.xowa.addons.*; import gplx.xowa.addons.wikis.*; import gplx.xowa.addons.wikis.ctgs.*;
|
|
|
|
|
import gplx.core.btries.*;
|
|
|
|
|
public class Xoctg_collation_enum {
|
|
|
|
|
public class Xoctg_collation_enum { // REF:https://www.mediawiki.org/wiki/Manual:$wgCategoryCollation
|
|
|
|
|
private final Btrie_rv trv = new Btrie_rv();
|
|
|
|
|
private final Btrie_slim_mgr trie = Btrie_slim_mgr.cs()
|
|
|
|
|
.Add_str_byte("uppercase" , Tid__uppercase)
|
|
|
|
|
.Add_str_byte("uca" , Tid__uca);
|
|
|
|
|
.Add_str_byte("uppercase" , Tid__uppercase)
|
|
|
|
|
.Add_str_byte("uca" , Tid__uca)
|
|
|
|
|
.Add_str_byte("numeric" , Tid__numeric) // NOTE: no logic implemented for numeric; DATE:2019-10-15
|
|
|
|
|
.Add_str_byte("identity" , Tid__identity) // NOTE: no logic implemented for identity; DATE:2019-10-15
|
|
|
|
|
;
|
|
|
|
|
public byte To_tid_or_fail(byte[] raw) {
|
|
|
|
|
byte tid = trie.Match_byte_or(trv, raw, 0, raw.length, Byte_.Max_value_127);
|
|
|
|
|
if (tid == Byte_.Max_value_127) throw Err_.new_unhandled_default(raw);
|
|
|
|
|
return tid;
|
|
|
|
|
}
|
|
|
|
|
public static final byte Tid__uppercase = 1, Tid__uca = 3;
|
|
|
|
|
public static final byte Tid__uppercase = 1, Tid__uca = 3, Tid__numeric = 4, Tid__identity = 5;
|
|
|
|
|
}
|
|
|
|
|