mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -20,9 +20,9 @@ import gplx.core.btries.*; import gplx.core.primitives.*; import gplx.dbs.*;
|
||||
import gplx.xowa.langs.vnts.*; import gplx.xowa.langs.vnts.converts.*;
|
||||
import gplx.xowa.parsers.htmls.*;
|
||||
public class Vnt_convert_lang {
|
||||
private final Xol_convert_mgr convert_mgr; private final Xol_vnt_regy vnt_regy;
|
||||
private final Vnt_convert_rule converter_rule; private final Vnt_html_doc_wkr html_convert_wkr; private final Mwh_doc_parser doc_parser = new Mwh_doc_parser();
|
||||
private final Bry_bfr bfr = Bry_bfr.new_(255), tmp_frame_bfr = Bry_bfr.new_(255), tmp_convert_bfr = Bry_bfr.new_(255);
|
||||
private final Xol_convert_mgr convert_mgr; private final Xol_vnt_regy vnt_regy;
|
||||
private final Vnt_convert_rule converter_rule; private final Vnt_html_doc_wkr html_convert_wkr; private final Mwh_doc_parser doc_parser = new Mwh_doc_parser();
|
||||
private final Bry_bfr bfr = Bry_bfr_.New_w_size(255), tmp_frame_bfr = Bry_bfr_.New_w_size(255), tmp_convert_bfr = Bry_bfr_.New_w_size(255);
|
||||
private byte[] src; private int src_len; private int pos;
|
||||
private Vnt_log_mgr log_mgr; private int tag_bgn, tag_end;
|
||||
public Vnt_convert_lang(Xol_convert_mgr convert_mgr, Xol_vnt_regy vnt_regy) {
|
||||
@@ -82,7 +82,7 @@ public class Vnt_convert_lang {
|
||||
}
|
||||
if (tag_bgn == -1) return false; // no "<" found;
|
||||
loop = true;
|
||||
cur = curly_bgn + 1; // TODO: resume at }-
|
||||
cur = curly_bgn + 1; // TODO_OLD: resume at }-
|
||||
while (loop) { // scan fwd for >
|
||||
byte b = src[cur];
|
||||
switch (b) {
|
||||
@@ -121,7 +121,7 @@ public class Vnt_convert_lang {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
frame_bfr.Add(Parse_recursive(Bry_bfr.new_(16), vnt_itm, depth + 1)); // Recursively parse another rule
|
||||
frame_bfr.Add(Parse_recursive(Bry_bfr_.New_w_size(16), vnt_itm, depth + 1)); // Recursively parse another rule
|
||||
bgn_pos = pos;
|
||||
break;
|
||||
case Tid__curly_end:
|
||||
@@ -180,10 +180,10 @@ public class Vnt_convert_lang {
|
||||
}
|
||||
}
|
||||
private static final byte Tid__curly_bgn = 1, Tid__curly_end = 2;
|
||||
private static final byte[] Bry__curly_bgn = Bry_.new_a7("-{"), Bry__curly_end = Bry_.new_a7("}-");
|
||||
private static final Btrie_fast_mgr trie = Btrie_fast_mgr.cs()
|
||||
private static final byte[] Bry__curly_bgn = Bry_.new_a7("-{"), Bry__curly_end = Bry_.new_a7("}-");
|
||||
private static final Btrie_fast_mgr trie = Btrie_fast_mgr.cs()
|
||||
.Add_bry_byte(Bry__curly_bgn, Tid__curly_bgn)
|
||||
.Add_bry_byte(Bry__curly_end, Tid__curly_end);
|
||||
public static final byte[] Bry__armor_bgn = Bry_.new_a7("-{R|"), Bry__armor_end = Bry_.new_a7("}-");
|
||||
public static final byte[] Bry__armor_bgn = Bry_.new_a7("-{R|"), Bry__armor_end = Bry_.new_a7("}-");
|
||||
private static final int max_depth = 32;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.x
|
||||
import gplx.core.btries.*; import gplx.core.primitives.*;
|
||||
import gplx.xowa.langs.vnts.*;
|
||||
class Vnt_convert_rule { // REF.MW: /languages/LanguageConverter.php|ConverterRule
|
||||
private final Vnt_flag_parser flag_parser = new Vnt_flag_parser(); private final Vnt_flag_code_mgr flag_codes = new Vnt_flag_code_mgr(); private final Vnt_flag_lang_mgr flag_langs = new Vnt_flag_lang_mgr();
|
||||
private final Vnt_rule_parser rule_parser = new Vnt_rule_parser(); private final Vnt_rule_undi_mgr rule_undis = new Vnt_rule_undi_mgr(); private final Vnt_rule_bidi_mgr rule_bidis = new Vnt_rule_bidi_mgr();
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr.new_();
|
||||
private final Ordered_hash cnv_marked_hash = Ordered_hash_.New_bry();
|
||||
private final Vnt_flag_parser flag_parser = new Vnt_flag_parser(); private final Vnt_flag_code_mgr flag_codes = new Vnt_flag_code_mgr(); private final Vnt_flag_lang_mgr flag_langs = new Vnt_flag_lang_mgr();
|
||||
private final Vnt_rule_parser rule_parser = new Vnt_rule_parser(); private final Vnt_rule_undi_mgr rule_undis = new Vnt_rule_undi_mgr(); private final Vnt_rule_bidi_mgr rule_bidis = new Vnt_rule_bidi_mgr();
|
||||
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
|
||||
private final Ordered_hash cnv_marked_hash = Ordered_hash_.New_bry();
|
||||
private Vnt_convert_lang converter;
|
||||
private Xol_vnt_regy vnt_regy; private byte[] vnt_key;
|
||||
private Vnt_log_mgr log_mgr;
|
||||
@@ -30,7 +30,7 @@ class Vnt_convert_rule { // REF.MW: /languages/LanguageConverter.php|ConverterRu
|
||||
public byte[] Display() {return display;} private byte[] display;
|
||||
public byte[] Title() {return title;} private byte[] title;
|
||||
public byte Action() {return action;} private byte action;
|
||||
public Vnt_rule_undi_mgr Cnv_tbl() {return cnv_tbl;} private final Vnt_rule_undi_mgr cnv_tbl = new Vnt_rule_undi_mgr();
|
||||
public Vnt_rule_undi_mgr Cnv_tbl() {return cnv_tbl;} private final Vnt_rule_undi_mgr cnv_tbl = new Vnt_rule_undi_mgr();
|
||||
public Vnt_convert_rule(Vnt_convert_lang converter, Xol_vnt_regy vnt_regy, Vnt_log_mgr log_mgr) {
|
||||
this.converter = converter; this.log_mgr = log_mgr;
|
||||
this.vnt_regy = vnt_regy;
|
||||
@@ -181,7 +181,7 @@ class Vnt_convert_rule { // REF.MW: /languages/LanguageConverter.php|ConverterRu
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
private final static byte[]
|
||||
private final static byte[]
|
||||
Bry__error_bgn = Bry_.new_a7("<span class=\"error\">vnt error")
|
||||
, Bry__error_end = Bry_.new_a7("</span>")
|
||||
, Bry__undi_spr = Bry_.new_u8("⇒")
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||
import org.junit.*; import gplx.xowa.langs.vnts.*;
|
||||
public class Vnt_flag_parser_tst {
|
||||
private final Vnt_flag_parser_fxt fxt = new Vnt_flag_parser_fxt();
|
||||
private final Vnt_flag_parser_fxt fxt = new Vnt_flag_parser_fxt();
|
||||
@Test public void Basic() {fxt.Test_parse("D" , "D");}
|
||||
@Test public void Multiple() {fxt.Test_parse("+;S;E" , "+;S;E");}
|
||||
@Test public void Ws() {fxt.Test_parse(" + ; S ; E " , "+;S;E");}
|
||||
@@ -42,10 +42,10 @@ public class Vnt_flag_parser_tst {
|
||||
@Test public void Lang__zap__codes() {fxt.Test_parse("+;S;zh-hans;" , "zh-hans");}
|
||||
}
|
||||
class Vnt_flag_parser_fxt {
|
||||
private final Vnt_flag_parser parser = new Vnt_flag_parser();
|
||||
private final Vnt_flag_code_mgr codes = new Vnt_flag_code_mgr(); private final Vnt_flag_lang_mgr langs = new Vnt_flag_lang_mgr();
|
||||
private final Xol_vnt_regy vnt_regy = Xol_vnt_regy_fxt.new_chinese();
|
||||
private final Bry_bfr bfr = Bry_bfr.new_();
|
||||
private final Vnt_flag_parser parser = new Vnt_flag_parser();
|
||||
private final Vnt_flag_code_mgr codes = new Vnt_flag_code_mgr(); private final Vnt_flag_lang_mgr langs = new Vnt_flag_lang_mgr();
|
||||
private final Xol_vnt_regy vnt_regy = Xol_vnt_regy_fxt.new_chinese();
|
||||
private final Bry_bfr bfr = Bry_bfr_.New();
|
||||
public void Test_parse(String raw, String expd) {
|
||||
byte[] src = Bry_.new_u8(raw);
|
||||
parser.Parse(codes, langs, vnt_regy, src, 0, src.length);
|
||||
|
||||
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||
import gplx.dbs.*;
|
||||
public class Vnt_log_tbl implements Rls_able {
|
||||
private final String tbl_name = "log_vnt"; private final Dbmeta_fld_list flds = Dbmeta_fld_list.new_();
|
||||
private final String fld_uid, fld_page_id, fld_rule_idx
|
||||
private final String tbl_name = "log_vnt"; private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
|
||||
private final String fld_uid, fld_page_id, fld_rule_idx
|
||||
, fld_flag_count, fld_lang_count, fld_undi_count, fld_bidi_count
|
||||
, fld_flag_add, fld_flag_del, fld_flag_aout, fld_flag_hide, fld_flag_raw, fld_flag_show, fld_flag_descrip, fld_flag_name, fld_flag_title, fld_flag_err
|
||||
, fld_vnt_0, fld_vnt_1, fld_vnt_2, fld_vnt_3, fld_vnt_4, fld_vnt_5, fld_vnt_6, fld_vnt_7, fld_vnt_8, fld_vnt_9
|
||||
@@ -59,7 +59,7 @@ public class Vnt_log_tbl implements Rls_able {
|
||||
this.fld_src_txt = flds.Add_text("src_txt");
|
||||
conn.Rls_reg(this);
|
||||
}
|
||||
public Db_conn Conn() {return conn;} private final Db_conn conn;
|
||||
public Db_conn Conn() {return conn;} private final Db_conn conn;
|
||||
public void Rls() {
|
||||
stmt_insert = Db_stmt_.Rls(stmt_insert);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.parsers.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||
import gplx.xowa.langs.vnts.*;
|
||||
class Vnt_rule_parser_fxt {
|
||||
private final Vnt_rule_parser parser = new Vnt_rule_parser(); private final Vnt_rule_undi_mgr undis = new Vnt_rule_undi_mgr(); private final Vnt_rule_bidi_mgr bidis = new Vnt_rule_bidi_mgr();
|
||||
private final Bry_bfr bfr = Bry_bfr.new_(255);
|
||||
private final Vnt_rule_parser parser = new Vnt_rule_parser(); private final Vnt_rule_undi_mgr undis = new Vnt_rule_undi_mgr(); private final Vnt_rule_bidi_mgr bidis = new Vnt_rule_bidi_mgr();
|
||||
private final Bry_bfr bfr = Bry_bfr_.New_w_size(255);
|
||||
public Vnt_rule_parser_fxt() {
|
||||
Xol_vnt_regy vnt_regy = new Xol_vnt_regy();
|
||||
vnt_regy.Add(Bry_.new_a7("x1"), Bry_.new_a7("lang1"));
|
||||
|
||||
Reference in New Issue
Block a user