1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-09-13 21:54:44 -04:00
parent 2145f6382c
commit 5fe27b5b3b
649 changed files with 4726 additions and 3432 deletions

View File

@@ -60,7 +60,7 @@ class Btrie_u8_itm {
byte[] asymmetric_bry = case_itm.Asymmetric_bry();
if (asymmetric_bry != null) { // case_itm has asymmetry_bry; only itms in Xol_case_itm_ that are created with Tid_upper and Tid_lower will be non-null
rv.asymmetric_bry = asymmetric_bry; // set itm to asymmetric_bry; EX: for İ, asymmetric_bry = i
nxts.Add_bry_obj(asymmetric_bry, rv); // add the asymmetric_bry to the hash; in above example, this allows "i" to match "İ"
// nxts.Add_bry_obj(asymmetric_bry, rv); // add the asymmetric_bry to the hash; in above example, this allows "i" to match "İ"
}
}
return rv;

View File

@@ -148,7 +148,8 @@ class Hash_adp_bry_itm_ci_u8 extends Hash_adp_bry_itm_base {
}
else { // known itm; use its hash_code
b_int = itm.Hashcode_lo();
i += itm.Len_lo() - 1;
int b_len = Utf8_.Len_of_char_by_1st_byte(b); // NOTE: must calc b_len for langs with asymmetric upper / lower; PAGE:tr.w:Zvishavane DATE:2015-09-07
i += b_len - 1;
}
rv = (31 * rv) + b_int;
}
@@ -176,7 +177,7 @@ class Hash_adp_bry_itm_ci_u8 extends Hash_adp_bry_itm_base {
if (!Bry_.Match(src, src_c_bgn, src_c_end, trg, trg_c_bgn, trg_c_end)) return false;// syms do not match; return false;
}
else {
if (!src_c_itm.Eq_lo(trg_c_itm)) return false; // lower-case hash-codes don't match; return false;
if (src_c_itm.Utf8_id_lo() != trg_c_itm.Utf8_id_lo()) return false; // lower-case utf8-ids don't match; return false; NOTE: using utf8-ids instead of hash-code to handle asymmetric brys; DATE:2015-09-07
}
src_c_bgn = src_c_end;
trg_c_bgn = trg_c_end;

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.intl; import gplx.*;
public interface Gfo_case_itm {
boolean Eq_lo(Gfo_case_itm itm);
int Hashcode_lo();
int Len_lo();
byte[] Asymmetric_bry();
int Utf8_id_lo(); // lower-case byte or byte[] as single utf8 int
}