mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.9.2.1
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user