mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.7.2.1
This commit is contained in:
@@ -16,7 +16,7 @@ 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.xowa; import gplx.*;
|
||||
import gplx.xowa.langs.cases.*;
|
||||
import gplx.core.btries.*; import gplx.xowa.langs.cases.*;
|
||||
import gplx.xowa.xtns.scribunto.*;
|
||||
public class Xow_ns_mgr implements GfoInvkAble, gplx.lists.ComparerAble {
|
||||
private OrderedHash id_hash = OrderedHash_.new_(); // hash for retrieval by id
|
||||
@@ -37,7 +37,7 @@ public class Xow_ns_mgr implements GfoInvkAble, gplx.lists.ComparerAble {
|
||||
ns_count = 0;
|
||||
ns_file = null;
|
||||
}
|
||||
public ByteTrieMgr_slim Category_trie() {return category_trie;} private ByteTrieMgr_slim category_trie;
|
||||
public Btrie_slim_mgr Category_trie() {return category_trie;} private Btrie_slim_mgr category_trie;
|
||||
public Xow_ns Ns_main() {return ns_main;} private Xow_ns ns_main;
|
||||
public Xow_ns Ns_template() {return ns_template;} private Xow_ns ns_template;
|
||||
public Xow_ns Ns_file() {return ns_file;} private Xow_ns ns_file;
|
||||
@@ -152,8 +152,8 @@ public class Xow_ns_mgr implements GfoInvkAble, gplx.lists.ComparerAble {
|
||||
case Xow_ns_.Id_category:
|
||||
ns_category = ns;
|
||||
if (category_trie == null)
|
||||
category_trie = ByteTrieMgr_slim.new_(ns.Case_match() == Xow_ns_case_.Id_all);
|
||||
category_trie.Add(ns.Name_bry(), this);
|
||||
category_trie = Btrie_slim_mgr.new_(ns.Case_match() == Xow_ns_case_.Id_all);
|
||||
category_trie.Add_obj(ns.Name_bry(), this);
|
||||
break;
|
||||
}
|
||||
++ns_count;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Xow_wiki implements GfoInvkAble {
|
||||
props.SiteName_(domain_tid).ServerName_(domain_bry);
|
||||
props.ContentLanguage_(lang.Key_bry());
|
||||
Pf_func_.Reg(lang.Func_regy(), lang);
|
||||
special_mgr = new Xows_mgr(this);
|
||||
special_mgr = new Xows_mgr(this, lang);
|
||||
stats = new Xow_wiki_stats(this);
|
||||
xwiki_mgr = new Xow_xwiki_mgr(this);
|
||||
xwiki_mgr.Add_full(domain_bry, domain_bry); // add full name to xwiki_mgr; needed for lookup in home ns; EX: [[en.wikipedia.org:Earth]]
|
||||
|
||||
@@ -32,7 +32,7 @@ class Xow_wiki_fxt {
|
||||
public void Test_getPageByTtl(String ttl_str, String expd) {
|
||||
Xow_wiki wiki = fxt.Wiki();
|
||||
byte[] ttl_bry = Bry_.new_ascii_(ttl_str);
|
||||
Xoa_url url = new Xoa_url().Raw_(ttl_bry);
|
||||
Xoa_url url = Xoa_url.blank_().Raw_(ttl_bry);
|
||||
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, ttl_bry);
|
||||
Xoa_page actl = fxt.Wiki().GetPageByTtl(url, ttl);
|
||||
if (expd == null) Tfds.Eq_true(actl.Missing());
|
||||
|
||||
@@ -20,7 +20,7 @@ import gplx.xowa.wikis.*;
|
||||
public class Xow_xwiki_mgr implements GfoInvkAble {
|
||||
public Xow_xwiki_mgr(Xow_wiki wiki) {this.wiki = wiki;} private Xow_wiki wiki;
|
||||
public Xow_lang_mgr Lang_mgr() {return lang_mgr;} private Xow_lang_mgr lang_mgr = Xow_lang_mgr.dflt_();
|
||||
public int Len() {return list.Count();} private OrderedHash list = OrderedHash_.new_bry_(); Hash_adp_bry hash = Hash_adp_bry.ci_();
|
||||
public int Len() {return list.Count();} private OrderedHash list = OrderedHash_.new_bry_(); private Hash_adp_bry hash = Hash_adp_bry.ci_ascii_(); // ASCII:lang_code
|
||||
public void Clear() {hash.Clear(); list.Clear();}
|
||||
public Xow_xwiki_itm Get_at(int i) {return (Xow_xwiki_itm)list.FetchAt(i);}
|
||||
public Xow_xwiki_itm Get_by_key(byte[] key) {return (Xow_xwiki_itm)hash.Get_by_bry(key);}
|
||||
@@ -88,7 +88,7 @@ public class Xow_xwiki_mgr implements GfoInvkAble {
|
||||
String Exec_itms_print(byte[] raw) {
|
||||
Bry_fmtr fmtr = Bry_fmtr.new_bry_(raw, "wiki_key");//, "wiki_type_url", "wiki_lang", "wiki_name", "wiki_logo_url");
|
||||
Bry_bfr tmp_bfr = wiki.Utl_bry_bfr_mkr().Get_k004();
|
||||
Hash_adp_bry seen = Hash_adp_bry.ci_();
|
||||
Hash_adp_bry seen = Hash_adp_bry.ci_ascii_(); // ASCII:url_domain; EX:en.wikipedia.org
|
||||
int wikis_len = list.Count();
|
||||
for (int i = 0; i < wikis_len; i++) {
|
||||
Xow_xwiki_itm itm = (Xow_xwiki_itm)list.FetchAt(i);
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
public class Xowc_xtns implements GfoInvkAble {
|
||||
private Hash_adp_bry hash = Hash_adp_bry.ci_();
|
||||
private Hash_adp_bry hash = Hash_adp_bry.ci_ascii_();
|
||||
public Xowc_xtns() {hash.Add(Xowc_xtn_pages.Xtn_key, itm_pages);}
|
||||
public Xowc_xtn_pages Itm_pages() {return itm_pages;} private Xowc_xtn_pages itm_pages = new Xowc_xtn_pages();
|
||||
public Object Get_by_key(byte[] key) {return hash.Get_by_bry(key);}
|
||||
|
||||
Reference in New Issue
Block a user