1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.8.2.1'

This commit is contained in:
gnosygnu
2016-08-07 21:36:50 -04:00
parent b0fdf78a41
commit e4a2af026b
165 changed files with 2534 additions and 1247 deletions

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx;
import gplx.core.brys.*; import gplx.core.brys.fmts.*;
public class Bry_fmt {
private final Object thread_lock = new Object();
private byte[] src;
private Bry_fmt_itm[] itms; private int itms_len;
private Bfr_fmt_arg[] args = Bfr_fmt_arg.Ary_empty;
@@ -43,6 +44,10 @@ public class Bry_fmt {
Bld_many(bfr, vals_ary);
return bfr.To_str_and_clear();
}
public byte[] Bld_many_to_bry(Bry_bfr bfr, Object... vals_ary) {
Bld_many(bfr, vals_ary);
return bfr.To_bry_and_clear();
}
public void Bld_many(Bry_bfr bfr, Object... vals_ary) {
if (dirty) Compile();
int vals_len = vals_ary.length;
@@ -64,15 +69,18 @@ public class Bry_fmt {
}
public String To_str() {return Bld_many_to_str_auto_bfr(vals);}
private void Compile() {
dirty = false;
this.itms = Bry_fmt_parser_.Parse(Byte_ascii.Tilde, Byte_ascii.Curly_bgn, Byte_ascii.Curly_end, args, keys, src);
this.itms_len = itms.length;
synchronized (thread_lock) {
dirty = false;
this.itms = Bry_fmt_parser_.Parse(Byte_ascii.Tilde, Byte_ascii.Curly_bgn, Byte_ascii.Curly_end, args, keys, src);
this.itms_len = itms.length;
}
}
public static Bry_fmt New(String fmt, String... keys) {return new Bry_fmt(Bry_.new_u8(fmt), Bry_.Ary(keys), Bfr_fmt_arg.Ary_empty);}
public static Bry_fmt New(byte[] fmt, String... keys) {return new Bry_fmt(fmt , Bry_.Ary(keys), Bfr_fmt_arg.Ary_empty);}
public static String Make_str(String fmt_str, Object... vals) {return Auto(fmt_str).Vals_(vals).To_str();}
public static Bry_fmt Auto(String fmt_str) {
byte[] fmt_bry = Bry_.new_u8(fmt_str);
public static Bry_fmt Auto_nl_apos(String... lines) {return Auto(Bry_.New_u8_nl_apos(lines));}
public static Bry_fmt Auto(String fmt_str) {return Auto(Bry_.new_u8(fmt_str));}
public static Bry_fmt Auto(byte[] fmt_bry) {
byte[][] keys_bry = Bry_fmt_parser_.Parse_keys(fmt_bry);
return new Bry_fmt(fmt_bry, keys_bry, Bfr_fmt_arg.Ary_empty);
}

View File

@@ -16,53 +16,73 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx;
import org.junit.*; import gplx.core.times.*;
public class DateAdp__tst {
import org.junit.*; import gplx.core.tests.*;
public class DateAdp__tst {
private final DateAdp__fxt fxt = new DateAdp__fxt();
@Test public void Parse_gplx() {
tst_Parse_gplx("99991231_235959.999", "99991231_235959.999");
tst_Parse_gplx("20090430_213200.123", "20090430_213200.123");
tst_Parse_gplx("20090430_213200" , "20090430_213200.000");
tst_Parse_gplx("20090430" , "20090430_000000.000");
fxt.Test__parse_gplx("99991231_235959.999" , "99991231_235959.999");
fxt.Test__parse_gplx("20090430_213200.123" , "20090430_213200.123");
fxt.Test__parse_gplx("20090430_213200" , "20090430_213200.000");
fxt.Test__parse_gplx("20090430" , "20090430_000000.000");
}
@Test public void Parse_separators() {
tst_Parse_gplx("2009-04-30 21:32:00.123", "20090430_213200.123");
tst_Parse_gplx("2009-04-30 21:32:00" , "20090430_213200.000");
tst_Parse_gplx("2009-04-30" , "20090430_000000.000");
fxt.Test__parse_gplx("2009-04-30 21:32:00.123" , "20090430_213200.123");
fxt.Test__parse_gplx("2009-04-30 21:32:00" , "20090430_213200.000");
fxt.Test__parse_gplx("2009-04-30" , "20090430_000000.000");
}
@Test public void Parse_utc() {
fxt.Test__parse_gplx("2015-12-26T10:03:53Z" , "20151226_100353.000");
}
@Test public void DayOfWeek() {
tst_DayOfWeek("2012-01-18", 3); //3=Wed
} void tst_DayOfWeek(String raw, int expd) {Tfds.Eq(expd, DateAdp_.parse_gplx(raw).DayOfWeek());}
@Test public void WeekOfYear() {
tst_WeekOfYear("2006-02-01", 5); // 1-1:Sun;2-1:Wed
tst_WeekOfYear("2007-02-01", 5); // 1-1:Mon;2-1:Thu
tst_WeekOfYear("2008-02-01", 5); // 1-1:Tue;2-1:Fri
tst_WeekOfYear("2009-02-01", 6); // 1-1:Thu;2-1:Sun
tst_WeekOfYear("2010-02-01", 6); // 1-1:Fri;2-1:Mon
tst_WeekOfYear("2011-02-01", 6); // 1-1:Sat;2-1:Tue
} void tst_WeekOfYear(String raw, int expd) {Tfds.Eq(expd, DateAdp_.parse_gplx(raw).WeekOfYear());}
@Test public void DayOfYear() {
tst_DayOfYear("2012-01-01", 1);
tst_DayOfYear("2012-02-29", 60);
tst_DayOfYear("2012-12-31", 366);
} void tst_DayOfYear(String raw, int expd) {Tfds.Eq(expd, DateAdp_.parse_gplx(raw).DayOfYear());}
@Test public void Timestamp_unix() {
tst_Timestamp_unix("1970-01-01 00:00:00", 0);
tst_Timestamp_unix("2012-01-01 00:00:00", 1325376000);
} void tst_Timestamp_unix(String raw, long expd) {Tfds.Eq(expd, DateAdp_.parse_gplx(raw).Timestamp_unix());}
@Test public void DaysInMonth() {
tst_DaysInMonth("2012-01-01", 31);
tst_DaysInMonth("2012-02-01", 29);
tst_DaysInMonth("2012-04-01", 30);
tst_DaysInMonth("2011-02-01", 28);
} void tst_DaysInMonth(String raw, int expd) {Tfds.Eq(expd, DateAdp_.DaysInMonth(DateAdp_.parse_gplx(raw)));}
@Test public void XtoUtc() {
tst_XtoUtc("2012-01-01 00:00", "2012-01-01 05:00"); //4=Wed
} void tst_XtoUtc(String raw, String expd) {Tfds.Eq(expd, DateAdp_.parse_gplx(raw).XtoUtc().XtoStr_fmt_yyyy_MM_dd_HH_mm());}
void tst_Parse_gplx(String raw, String expd) {
DateAdp date = DateAdp_.parse_gplx(raw);
String actl = date.XtoStr_gplx();
Tfds.Eq(expd, actl);
fxt.Test__day_of_week("2012-01-18", 3); //3=Wed
}
@Test public void WeekOfYear() {
fxt.Test__week_of_year("2006-02-01", 5); // 1-1:Sun;2-1:Wed
fxt.Test__week_of_year("2007-02-01", 5); // 1-1:Mon;2-1:Thu
fxt.Test__week_of_year("2008-02-01", 5); // 1-1:Tue;2-1:Fri
fxt.Test__week_of_year("2009-02-01", 6); // 1-1:Thu;2-1:Sun
fxt.Test__week_of_year("2010-02-01", 6); // 1-1:Fri;2-1:Mon
fxt.Test__week_of_year("2011-02-01", 6); // 1-1:Sat;2-1:Tue
}
@Test public void DayOfYear() {
fxt.Test__day_of_year("2012-01-01", 1);
fxt.Test__day_of_year("2012-02-29", 60);
fxt.Test__day_of_year("2012-12-31", 366);
}
@Test public void Timestamp_unix() {
fxt.Test__timestamp_unix("1970-01-01 00:00:00", 0);
fxt.Test__timestamp_unix("2012-01-01 00:00:00", 1325376000);
}
@Test public void DaysInMonth() {
fxt.Test__days_in_month("2012-01-01", 31);
fxt.Test__days_in_month("2012-02-01", 29);
fxt.Test__days_in_month("2012-04-01", 30);
fxt.Test__days_in_month("2011-02-01", 28);
}
@Test public void XtoUtc() {
fxt.Test__to_utc("2012-01-01 00:00", "2012-01-01 05:00"); //4=Wed
}
}
class DateAdp__fxt {
public void Test__parse_gplx(String raw, String expd) {
Gftest.Eq__str(expd, DateAdp_.parse_gplx(raw).XtoStr_gplx());
}
public void Test__day_of_week(String raw, int expd) {
Gftest.Eq__int(expd, DateAdp_.parse_gplx(raw).DayOfWeek());
}
public void Test__week_of_year(String raw, int expd) {
Gftest.Eq__int(expd, DateAdp_.parse_gplx(raw).WeekOfYear());
}
public void Test__day_of_year(String raw, int expd) {
Gftest.Eq__int(expd, DateAdp_.parse_gplx(raw).DayOfYear());
}
public void Test__days_in_month(String raw, int expd) {
Gftest.Eq__int(expd, DateAdp_.DaysInMonth(DateAdp_.parse_gplx(raw)));
}
public void Test__timestamp_unix(String raw, long expd) {
Gftest.Eq__long(expd, DateAdp_.parse_gplx(raw).Timestamp_unix());
}
public void Test__to_utc(String raw, String expd) {
Tfds.Eq(expd, DateAdp_.parse_gplx(raw).XtoUtc().XtoStr_fmt_yyyy_MM_dd_HH_mm());
}
DateAdp_parser bldr = DateAdp_parser.new_();
}

View File

@@ -0,0 +1,38 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.core.brys.args; import gplx.*; import gplx.core.*; import gplx.core.brys.*;
import gplx.core.brys.*;
public class Bfr_arg__bry_fmt implements Bfr_arg {
private final Bry_fmt fmt;
private Object[] arg_ary;
public Bfr_arg__bry_fmt(Bry_fmt fmt, Object... arg_ary) {
this.fmt = fmt;
Args_(arg_ary);
}
public void Bfr_arg__clear() {arg_ary = null;}
public boolean Bfr_arg__missing() {return arg_ary == null;}
public Bfr_arg__bry_fmt Args_(Object... arg_ary) {
this.arg_ary = arg_ary;
return this;
}
public void Bfr_arg__add(Bry_bfr bfr) {
if (Bfr_arg__missing()) return;
fmt.Bld_many(bfr, arg_ary);
}
}

View File

@@ -86,7 +86,7 @@ public class Bry_fmt_parser_ {
if (rhs_pos - lhs_pos == 0) throw Err_.new_("bry_fmt", "{} will result in empty key", "src", src);
byte[] key = Bry_.Mid(src, lhs_pos, rhs_pos);
if (!list.Has(key)) list.Add(key, key);
pos = rhs_pos + 1;
pos = rhs_pos; // NOTE: auto-increment done at top of loop
}
return (byte[][])list.To_ary(byte[].class);
} private static final byte[] Bry_arg_lhs = Bry_.new_a7("~{");

View File

@@ -18,11 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.core.brys.fmts; import gplx.*; import gplx.core.*; import gplx.core.brys.*;
import org.junit.*;
public class Bry_keys_parser_tst {
private final Bry_keys_parser_fxt fxt = new Bry_keys_parser_fxt();
private final Bry_keys_parser_fxt fxt = new Bry_keys_parser_fxt();
@Test public void None() {fxt.Test("a");}
@Test public void One() {fxt.Test("~{a}" , "a");}
@Test public void Many() {fxt.Test("~{a}b~{c}d~{e}" , "a", "c", "e");}
@Test public void Dupe() {fxt.Test("~{a}b~{a}" , "a");}
@Test public void Bug__space() {fxt.Test("~{a}~{b} ~{c}" , "a", "b", "c");} // DATE:2016-08-02
}
class Bry_keys_parser_fxt {
public void Test(String fmt, String... expd) {

View File

@@ -0,0 +1,35 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.langs.htmls.entitys; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*;
public class Gfh_entity_ {
public static final String
Nl_str = "&#10;"
;
public static final byte[]
Lt_bry = Bry_.new_a7("&lt;"), Gt_bry = Bry_.new_a7("&gt;")
, Amp_bry = Bry_.new_a7("&amp;"), Quote_bry = Bry_.new_a7("&quot;")
, Apos_num_bry = Bry_.new_a7("&#39;")
, Apos_key_bry = Bry_.new_a7("&apos;")
, Eq_bry = Bry_.new_a7("&#61;")
, Nl_bry = Bry_.new_a7(Nl_str), Space_bry = Bry_.new_a7("&#32;")
, Pipe_bry = Bry_.new_a7("&#124;")
, Colon_bry = Bry_.new_a7("&#58;"), Underline_bry = Bry_.new_a7("&#95;"), Asterisk_bry = Bry_.new_a7("&#42;")
, Brack_bgn_bry = Bry_.new_a7("&#91;"), Brack_end_bry = Bry_.new_a7("&#93;")
, Nbsp_num_bry = Bry_.new_a7("&#160;")
;
}

View File

@@ -0,0 +1,57 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.langs.htmls.entitys; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*;
public class Gfh_entity_itm { // TS:immutable
public Gfh_entity_itm(byte tid, int char_int, byte[] xml_name_bry) {
this.tid = tid;
this.char_int = char_int;
this.u8_bry = gplx.core.intls.Utf16_.Encode_int_to_bry(char_int);
this.xml_name_bry = xml_name_bry;
this.key_name_len = xml_name_bry.length - 2; // 2 for & and ;
}
public byte Tid() {return tid;} private final byte tid;
public int Char_int() {return char_int;} private final int char_int; // val; EX: 160
public byte[] U8_bry() {return u8_bry;} private final byte[] u8_bry; // EX: new byte[] {192, 160}; (C2, A0)
public byte[] Xml_name_bry() {return xml_name_bry;} private final byte[] xml_name_bry; // EX: "&nbsp;"
public int Key_name_len() {return key_name_len;} private final int key_name_len; // EX: "nbsp".Len
public void Print_ncr(Bry_bfr bfr) {
switch (char_int) {
case Byte_ascii.Lt: case Byte_ascii.Gt: case Byte_ascii.Quote: case Byte_ascii.Amp:
bfr.Add(xml_name_bry); // NOTE: never write actual char; EX: "&lt;" should be written as "&lt;", not "<"
break;
default:
bfr.Add(Escape_bgn); // &#
bfr.Add_int_variable(char_int); // 160
bfr.Add_byte(Byte_ascii.Semic); // ;
break;
}
}
public void Print_literal(Bry_bfr bfr) {
switch (char_int) {
case Byte_ascii.Lt: bfr.Add(Gfh_entity_.Lt_bry); break; // NOTE: never write actual char; EX: "&lt;" should be written as "&lt;", not "<"; MW does same; DATE:2014-11-07
case Byte_ascii.Gt: bfr.Add(Gfh_entity_.Gt_bry); break;
case Byte_ascii.Quote: bfr.Add(Gfh_entity_.Quote_bry); break;
case Byte_ascii.Amp: bfr.Add(Gfh_entity_.Amp_bry); break;
default: bfr.Add(u8_bry); break; // write literal; EX: "[" not "&#91;"
}
}
private static final byte[] Escape_bgn = Bry_.new_a7("&#");
public static final byte Tid_name_std = 1, Tid_name_xowa = 2, Tid_num_hex = 3, Tid_num_dec = 4;
public static final int Char_int_null = -1;
}

View File

@@ -0,0 +1,317 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.langs.htmls.entitys; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*;
import gplx.core.btries.*;
public class Gfh_entity_trie { // TS
public static final String // NOTE: top_define; entities needed for <nowiki> escaping
Str__xowa_lt = "&xowa_lt;"
, Str__xowa_brack_bgn = "&xowa_brack_bgn;"
, Str__xowa_brack_end = "&xowa_brack_end;"
, Str__xowa_pipe = "&xowa_pipe;"
, Str__xowa_apos = "&xowa_apos;"
, Str__xowa_colon = "&xowa_colon;"
, Str__xowa_underline = "&xowa_underline;"
, Str__xowa_asterisk = "&xowa_asterisk;"
, Str__xowa_space = "&xowa_space;"
, Str__xowa_nl = "&xowa_nl;"
, Str__xowa_dash = "&xowa_dash;"
;
public static final Btrie_slim_mgr Instance = New(); Gfh_entity_trie() {}
private static Btrie_slim_mgr New() {// REF.MW: Sanitizer|$wgHtmlEntities; NOTE:added apos
Btrie_slim_mgr rv = Btrie_slim_mgr.cs();
Add_name(rv, Bool_.Y, 60, Str__xowa_lt);
Add_name(rv, Bool_.Y, 91, Str__xowa_brack_bgn);
Add_name(rv, Bool_.Y, 93, Str__xowa_brack_end);
Add_name(rv, Bool_.Y, 124, Str__xowa_pipe);
Add_name(rv, Bool_.Y, 39, Str__xowa_apos);
Add_name(rv, Bool_.Y, 58, Str__xowa_colon);
Add_name(rv, Bool_.Y, 95, Str__xowa_underline);
Add_name(rv, Bool_.Y, 42, Str__xowa_asterisk);
Add_name(rv, Bool_.Y, 32, Str__xowa_space);
Add_name(rv, Bool_.Y, 10, Str__xowa_nl);
Add_name(rv, Bool_.Y, 45, Str__xowa_dash);
Add_name(rv, Bool_.N, 39, "&apos;");
Add_name(rv, Bool_.N, 193, "&Aacute;");
Add_name(rv, Bool_.N, 225, "&aacute;");
Add_name(rv, Bool_.N, 194, "&Acirc;");
Add_name(rv, Bool_.N, 226, "&acirc;");
Add_name(rv, Bool_.N, 180, "&acute;");
Add_name(rv, Bool_.N, 198, "&AElig;");
Add_name(rv, Bool_.N, 230, "&aelig;");
Add_name(rv, Bool_.N, 192, "&Agrave;");
Add_name(rv, Bool_.N, 224, "&agrave;");
Add_name(rv, Bool_.N, 8501, "&alefsym;");
Add_name(rv, Bool_.N, 913, "&Alpha;");
Add_name(rv, Bool_.N, 945, "&alpha;");
Add_name(rv, Bool_.N, 38, "&amp;");
Add_name(rv, Bool_.N, 8743, "&and;");
Add_name(rv, Bool_.N, 8736, "&ang;");
Add_name(rv, Bool_.N, 197, "&Aring;");
Add_name(rv, Bool_.N, 229, "&aring;");
Add_name(rv, Bool_.N, 8776, "&asymp;");
Add_name(rv, Bool_.N, 195, "&Atilde;");
Add_name(rv, Bool_.N, 227, "&atilde;");
Add_name(rv, Bool_.N, 196, "&Auml;");
Add_name(rv, Bool_.N, 228, "&auml;");
Add_name(rv, Bool_.N, 8222, "&bdquo;");
Add_name(rv, Bool_.N, 914, "&Beta;");
Add_name(rv, Bool_.N, 946, "&beta;");
Add_name(rv, Bool_.N, 166, "&brvbar;");
Add_name(rv, Bool_.N, 8226, "&bull;");
Add_name(rv, Bool_.N, 8745, "&cap;");
Add_name(rv, Bool_.N, 199, "&Ccedil;");
Add_name(rv, Bool_.N, 231, "&ccedil;");
Add_name(rv, Bool_.N, 184, "&cedil;");
Add_name(rv, Bool_.N, 162, "&cent;");
Add_name(rv, Bool_.N, 935, "&Chi;");
Add_name(rv, Bool_.N, 967, "&chi;");
Add_name(rv, Bool_.N, 710, "&circ;");
Add_name(rv, Bool_.N, 9827, "&clubs;");
Add_name(rv, Bool_.N, 8773, "&cong;");
Add_name(rv, Bool_.N, 169, "&copy;");
Add_name(rv, Bool_.N, 8629, "&crarr;");
Add_name(rv, Bool_.N, 8746, "&cup;");
Add_name(rv, Bool_.N, 164, "&curren;");
Add_name(rv, Bool_.N, 8224, "&dagger;");
Add_name(rv, Bool_.N, 8225, "&Dagger;");
Add_name(rv, Bool_.N, 8595, "&darr;");
Add_name(rv, Bool_.N, 8659, "&dArr;");
Add_name(rv, Bool_.N, 176, "&deg;");
Add_name(rv, Bool_.N, 916, "&Delta;");
Add_name(rv, Bool_.N, 948, "&delta;");
Add_name(rv, Bool_.N, 9830, "&diams;");
Add_name(rv, Bool_.N, 247, "&divide;");
Add_name(rv, Bool_.N, 201, "&Eacute;");
Add_name(rv, Bool_.N, 233, "&eacute;");
Add_name(rv, Bool_.N, 202, "&Ecirc;");
Add_name(rv, Bool_.N, 234, "&ecirc;");
Add_name(rv, Bool_.N, 200, "&Egrave;");
Add_name(rv, Bool_.N, 232, "&egrave;");
Add_name(rv, Bool_.N, 8709, "&empty;");
Add_name(rv, Bool_.N, 8195, "&emsp;");
Add_name(rv, Bool_.N, 8194, "&ensp;");
Add_name(rv, Bool_.N, 917, "&Epsilon;");
Add_name(rv, Bool_.N, 949, "&epsilon;");
Add_name(rv, Bool_.N, 8801, "&equiv;");
Add_name(rv, Bool_.N, 919, "&Eta;");
Add_name(rv, Bool_.N, 951, "&eta;");
Add_name(rv, Bool_.N, 208, "&ETH;");
Add_name(rv, Bool_.N, 240, "&eth;");
Add_name(rv, Bool_.N, 203, "&Euml;");
Add_name(rv, Bool_.N, 235, "&euml;");
Add_name(rv, Bool_.N, 8364, "&euro;");
Add_name(rv, Bool_.N, 8707, "&exist;");
Add_name(rv, Bool_.N, 402, "&fnof;");
Add_name(rv, Bool_.N, 8704, "&forall;");
Add_name(rv, Bool_.N, 189, "&frac12;");
Add_name(rv, Bool_.N, 188, "&frac14;");
Add_name(rv, Bool_.N, 190, "&frac34;");
Add_name(rv, Bool_.N, 8260, "&frasl;");
Add_name(rv, Bool_.N, 915, "&Gamma;");
Add_name(rv, Bool_.N, 947, "&gamma;");
Add_name(rv, Bool_.N, 8805, "&ge;");
Add_name(rv, Bool_.N, 62, "&gt;");
Add_name(rv, Bool_.N, 8596, "&harr;");
Add_name(rv, Bool_.N, 8660, "&hArr;");
Add_name(rv, Bool_.N, 9829, "&hearts;");
Add_name(rv, Bool_.N, 8230, "&hellip;");
Add_name(rv, Bool_.N, 205, "&Iacute;");
Add_name(rv, Bool_.N, 237, "&iacute;");
Add_name(rv, Bool_.N, 206, "&Icirc;");
Add_name(rv, Bool_.N, 238, "&icirc;");
Add_name(rv, Bool_.N, 161, "&iexcl;");
Add_name(rv, Bool_.N, 204, "&Igrave;");
Add_name(rv, Bool_.N, 236, "&igrave;");
Add_name(rv, Bool_.N, 8465, "&image;");
Add_name(rv, Bool_.N, 8734, "&infin;");
Add_name(rv, Bool_.N, 8747, "&int;");
Add_name(rv, Bool_.N, 921, "&Iota;");
Add_name(rv, Bool_.N, 953, "&iota;");
Add_name(rv, Bool_.N, 191, "&iquest;");
Add_name(rv, Bool_.N, 8712, "&isin;");
Add_name(rv, Bool_.N, 207, "&Iuml;");
Add_name(rv, Bool_.N, 239, "&iuml;");
Add_name(rv, Bool_.N, 922, "&Kappa;");
Add_name(rv, Bool_.N, 954, "&kappa;");
Add_name(rv, Bool_.N, 923, "&Lambda;");
Add_name(rv, Bool_.N, 955, "&lambda;");
Add_name(rv, Bool_.N, 9001, "&lang;");
Add_name(rv, Bool_.N, 171, "&laquo;");
Add_name(rv, Bool_.N, 8592, "&larr;");
Add_name(rv, Bool_.N, 8656, "&lArr;");
Add_name(rv, Bool_.N, 8968, "&lceil;");
Add_name(rv, Bool_.N, 8220, "&ldquo;");
Add_name(rv, Bool_.N, 8804, "&le;");
Add_name(rv, Bool_.N, 8970, "&lfloor;");
Add_name(rv, Bool_.N, 8727, "&lowast;");
Add_name(rv, Bool_.N, 9674, "&loz;");
Add_name(rv, Bool_.N, 8206, "&lrm;");
Add_name(rv, Bool_.N, 8249, "&lsaquo;");
Add_name(rv, Bool_.N, 8216, "&lsquo;");
Add_name(rv, Bool_.N, 60, "&lt;");
Add_name(rv, Bool_.N, 175, "&macr;");
Add_name(rv, Bool_.N, 8212, "&mdash;");
Add_name(rv, Bool_.N, 181, "&micro;");
Add_name(rv, Bool_.N, 183, "&middot;");
Add_name(rv, Bool_.N, 8722, "&minus;");
Add_name(rv, Bool_.N, 924, "&Mu;");
Add_name(rv, Bool_.N, 956, "&mu;");
Add_name(rv, Bool_.N, 8711, "&nabla;");
Add_name(rv, Bool_.N, 160, "&nbsp;");
Add_name(rv, Bool_.N, 8211, "&ndash;");
Add_name(rv, Bool_.N, 8800, "&ne;");
Add_name(rv, Bool_.N, 8715, "&ni;");
Add_name(rv, Bool_.N, 172, "&not;");
Add_name(rv, Bool_.N, 8713, "&notin;");
Add_name(rv, Bool_.N, 8836, "&nsub;");
Add_name(rv, Bool_.N, 209, "&Ntilde;");
Add_name(rv, Bool_.N, 241, "&ntilde;");
Add_name(rv, Bool_.N, 925, "&Nu;");
Add_name(rv, Bool_.N, 957, "&nu;");
Add_name(rv, Bool_.N, 211, "&Oacute;");
Add_name(rv, Bool_.N, 243, "&oacute;");
Add_name(rv, Bool_.N, 212, "&Ocirc;");
Add_name(rv, Bool_.N, 244, "&ocirc;");
Add_name(rv, Bool_.N, 338, "&OElig;");
Add_name(rv, Bool_.N, 339, "&oelig;");
Add_name(rv, Bool_.N, 210, "&Ograve;");
Add_name(rv, Bool_.N, 242, "&ograve;");
Add_name(rv, Bool_.N, 8254, "&oline;");
Add_name(rv, Bool_.N, 937, "&Omega;");
Add_name(rv, Bool_.N, 969, "&omega;");
Add_name(rv, Bool_.N, 927, "&Omicron;");
Add_name(rv, Bool_.N, 959, "&omicron;");
Add_name(rv, Bool_.N, 8853, "&oplus;");
Add_name(rv, Bool_.N, 8744, "&or;");
Add_name(rv, Bool_.N, 170, "&ordf;");
Add_name(rv, Bool_.N, 186, "&ordm;");
Add_name(rv, Bool_.N, 216, "&Oslash;");
Add_name(rv, Bool_.N, 248, "&oslash;");
Add_name(rv, Bool_.N, 213, "&Otilde;");
Add_name(rv, Bool_.N, 245, "&otilde;");
Add_name(rv, Bool_.N, 8855, "&otimes;");
Add_name(rv, Bool_.N, 214, "&Ouml;");
Add_name(rv, Bool_.N, 246, "&ouml;");
Add_name(rv, Bool_.N, 182, "&para;");
Add_name(rv, Bool_.N, 8706, "&part;");
Add_name(rv, Bool_.N, 8240, "&permil;");
Add_name(rv, Bool_.N, 8869, "&perp;");
Add_name(rv, Bool_.N, 934, "&Phi;");
Add_name(rv, Bool_.N, 966, "&phi;");
Add_name(rv, Bool_.N, 928, "&Pi;");
Add_name(rv, Bool_.N, 960, "&pi;");
Add_name(rv, Bool_.N, 982, "&piv;");
Add_name(rv, Bool_.N, 177, "&plusmn;");
Add_name(rv, Bool_.N, 163, "&pound;");
Add_name(rv, Bool_.N, 8242, "&prime;");
Add_name(rv, Bool_.N, 8243, "&Prime;");
Add_name(rv, Bool_.N, 8719, "&prod;");
Add_name(rv, Bool_.N, 8733, "&prop;");
Add_name(rv, Bool_.N, 936, "&Psi;");
Add_name(rv, Bool_.N, 968, "&psi;");
Add_name(rv, Bool_.N, 34, "&quot;");
Add_name(rv, Bool_.N, 8730, "&radic;");
Add_name(rv, Bool_.N, 9002, "&rang;");
Add_name(rv, Bool_.N, 187, "&raquo;");
Add_name(rv, Bool_.N, 8594, "&rarr;");
Add_name(rv, Bool_.N, 8658, "&rArr;");
Add_name(rv, Bool_.N, 8969, "&rceil;");
Add_name(rv, Bool_.N, 8221, "&rdquo;");
Add_name(rv, Bool_.N, 8476, "&real;");
Add_name(rv, Bool_.N, 174, "&reg;");
Add_name(rv, Bool_.N, 8971, "&rfloor;");
Add_name(rv, Bool_.N, 929, "&Rho;");
Add_name(rv, Bool_.N, 961, "&rho;");
Add_name(rv, Bool_.N, 8207, "&rlm;");
Add_name(rv, Bool_.N, 8250, "&rsaquo;");
Add_name(rv, Bool_.N, 8217, "&rsquo;");
Add_name(rv, Bool_.N, 8218, "&sbquo;");
Add_name(rv, Bool_.N, 352, "&Scaron;");
Add_name(rv, Bool_.N, 353, "&scaron;");
Add_name(rv, Bool_.N, 8901, "&sdot;");
Add_name(rv, Bool_.N, 167, "&sect;");
Add_name(rv, Bool_.N, 173, "&shy;");
Add_name(rv, Bool_.N, 931, "&Sigma;");
Add_name(rv, Bool_.N, 963, "&sigma;");
Add_name(rv, Bool_.N, 962, "&sigmaf;");
Add_name(rv, Bool_.N, 8764, "&sim;");
Add_name(rv, Bool_.N, 9824, "&spades;");
Add_name(rv, Bool_.N, 8834, "&sub;");
Add_name(rv, Bool_.N, 8838, "&sube;");
Add_name(rv, Bool_.N, 8721, "&sum;");
Add_name(rv, Bool_.N, 8835, "&sup;");
Add_name(rv, Bool_.N, 185, "&sup1;");
Add_name(rv, Bool_.N, 178, "&sup2;");
Add_name(rv, Bool_.N, 179, "&sup3;");
Add_name(rv, Bool_.N, 8839, "&supe;");
Add_name(rv, Bool_.N, 223, "&szlig;");
Add_name(rv, Bool_.N, 932, "&Tau;");
Add_name(rv, Bool_.N, 964, "&tau;");
Add_name(rv, Bool_.N, 8756, "&there4;");
Add_name(rv, Bool_.N, 920, "&Theta;");
Add_name(rv, Bool_.N, 952, "&theta;");
Add_name(rv, Bool_.N, 977, "&thetasym;");
Add_name(rv, Bool_.N, 8201, "&thinsp;");
Add_name(rv, Bool_.N, 222, "&THORN;");
Add_name(rv, Bool_.N, 254, "&thorn;");
Add_name(rv, Bool_.N, 732, "&tilde;");
Add_name(rv, Bool_.N, 215, "&times;");
Add_name(rv, Bool_.N, 8482, "&trade;");
Add_name(rv, Bool_.N, 218, "&Uacute;");
Add_name(rv, Bool_.N, 250, "&uacute;");
Add_name(rv, Bool_.N, 8593, "&uarr;");
Add_name(rv, Bool_.N, 8657, "&uArr;");
Add_name(rv, Bool_.N, 219, "&Ucirc;");
Add_name(rv, Bool_.N, 251, "&ucirc;");
Add_name(rv, Bool_.N, 217, "&Ugrave;");
Add_name(rv, Bool_.N, 249, "&ugrave;");
Add_name(rv, Bool_.N, 168, "&uml;");
Add_name(rv, Bool_.N, 978, "&upsih;");
Add_name(rv, Bool_.N, 933, "&Upsilon;");
Add_name(rv, Bool_.N, 965, "&upsilon;");
Add_name(rv, Bool_.N, 220, "&Uuml;");
Add_name(rv, Bool_.N, 252, "&uuml;");
Add_name(rv, Bool_.N, 8472, "&weierp;");
Add_name(rv, Bool_.N, 926, "&Xi;");
Add_name(rv, Bool_.N, 958, "&xi;");
Add_name(rv, Bool_.N, 221, "&Yacute;");
Add_name(rv, Bool_.N, 253, "&yacute;");
Add_name(rv, Bool_.N, 165, "&yen;");
Add_name(rv, Bool_.N, 376, "&Yuml;");
Add_name(rv, Bool_.N, 255, "&yuml;");
Add_name(rv, Bool_.N, 918, "&Zeta;");
Add_name(rv, Bool_.N, 950, "&zeta;");
Add_name(rv, Bool_.N, 8205, "&zwj;");
Add_name(rv, Bool_.N, 8204, "&zwnj;");
Add_prefix(rv, Gfh_entity_itm.Tid_num_hex, "#x");
Add_prefix(rv, Gfh_entity_itm.Tid_num_hex, "#X");
Add_prefix(rv, Gfh_entity_itm.Tid_num_dec, "#");
return rv;
}
private static void Add_name(Btrie_slim_mgr trie, boolean tid_is_xowa, int char_int, String xml_name_str) {
byte itm_tid = tid_is_xowa ? Gfh_entity_itm.Tid_name_xowa : Gfh_entity_itm.Tid_name_std;
byte[] xml_name_bry = Bry_.new_a7(xml_name_str);
byte[] key = Bry_.Mid(xml_name_bry, 1, xml_name_bry.length); // ignore & for purpose of trie; EX: "amp;"; NOTE: must keep trailing ";" else "&amp " will be valid;
trie.Add_obj(key, new Gfh_entity_itm(itm_tid, char_int, xml_name_bry));
}
private static void Add_prefix(Btrie_slim_mgr trie, byte prefix_type, String prefix) {
byte[] prefix_ary = Bry_.new_u8(prefix);
Gfh_entity_itm itm = new Gfh_entity_itm(prefix_type, Gfh_entity_itm.Char_int_null, prefix_ary);
trie.Add_obj(prefix_ary, itm);
}
}