mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.8.1.1
This commit is contained in:
@@ -36,7 +36,7 @@ public class Map_dd2dms_func extends Pf_func_base {
|
||||
switch (((Byte_obj_val)key_tid_obj).Val()) {
|
||||
case Key_tid_plus: plus = val; break;
|
||||
case Key_tid_minus: minus = val; break;
|
||||
case Key_tid_precision: prec = Bry_.Xto_int_or(val, prec); break;
|
||||
case Key_tid_precision: prec = Bry_.To_int_or(val, prec); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class Map_dd2dms_func extends Pf_func_base {
|
||||
}
|
||||
public static final Map_dd2dms_func _ = new Map_dd2dms_func(); Map_dd2dms_func() {}
|
||||
private static final byte Key_tid_plus = 1, Key_tid_minus = 2, Key_tid_precision = 3;
|
||||
private static final Hash_adp_bry Key_hash = Hash_adp_bry.cs_()
|
||||
private static final Hash_adp_bry Key_hash = Hash_adp_bry.cs()
|
||||
.Add_str_byte("plus" , Key_tid_plus)
|
||||
.Add_str_byte("minus" , Key_tid_minus)
|
||||
.Add_str_byte("precision" , Key_tid_precision)
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Map_deg2dd_func extends Pf_func_base {
|
||||
@Override public void Func_evaluate(Xop_ctx ctx, byte[] src, Xot_invk caller, Xot_invk self, Bry_bfr bfr) {
|
||||
byte[] coord = Eval_argx(ctx, src, caller, self);
|
||||
byte[] precision_bry = Pf_func_.Eval_val_or(ctx, src, caller, self, self.Args_len(), 0, null);
|
||||
int prec = precision_bry == null ? -1 : Bry_.Xto_int_or(precision_bry, -1);
|
||||
int prec = precision_bry == null ? -1 : Bry_.To_int_or(precision_bry, -1);
|
||||
Map_math map_math = Map_math._;
|
||||
if (map_math.Ctor(coord, prec, Bry_.Empty, 2))
|
||||
bfr.Add_double(map_math.Coord_dec());
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Map_geolink_func extends Pf_func_base {
|
||||
case Key_tid_lat_neg: mer_x_neg = val; break;
|
||||
case Key_tid_long_pos: mer_y_pos = val; break;
|
||||
case Key_tid_long_min: mer_y_neg = val; break;
|
||||
case Key_tid_prec: prec = Bry_.Xto_int_or(val, prec); break;
|
||||
case Key_tid_prec: prec = Bry_.To_int_or(val, prec); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class Map_geolink_func extends Pf_func_base {
|
||||
*/
|
||||
public static final Map_geolink_func _ = new Map_geolink_func(); Map_geolink_func() {}
|
||||
private static final byte Key_tid_lat_val = 1, Key_tid_long_val = 2, Key_tid_lat_pos = 3, Key_tid_lat_neg = 4, Key_tid_long_pos = 5, Key_tid_long_min = 6, Key_tid_prec = 7;
|
||||
private static final Hash_adp_bry Key_hash = Hash_adp_bry.cs_()
|
||||
private static final Hash_adp_bry Key_hash = Hash_adp_bry.cs()
|
||||
.Add_str_byte("lat" , Key_tid_lat_val)
|
||||
.Add_str_byte("long" , Key_tid_long_val)
|
||||
.Add_str_byte("plusLat" , Key_tid_lat_pos)
|
||||
|
||||
@@ -43,7 +43,7 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
return error == 0;
|
||||
}
|
||||
public void Fail(Xop_ctx ctx, byte[] src, Xot_invk self, Bry_bfr bfr, byte[] pfunc_name) {
|
||||
String page_str = ctx.Cur_page().Url().Xto_full_str_safe();
|
||||
String page_str = ctx.Cur_page().Url().To_str();
|
||||
String pfunc_name_str = String_.new_u8(pfunc_name);
|
||||
String self_str = String_.new_u8(src, self.Src_bgn(), self.Src_end());
|
||||
switch (error) {
|
||||
@@ -183,7 +183,7 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
if (pos != Bry_.NotFound) // remove dlms from end of bry; EX: "123'" -> "123"
|
||||
word_end = pos;
|
||||
if (!Parse_input_word_is_compass(input[word_bgn])) { // if ( is_numeric( $v ) ) {
|
||||
double word_val = Bry_.XtoDoubleByPosOr(input, word_bgn, word_end, Double_.NaN);
|
||||
double word_val = Bry_.To_double_or(input, word_bgn, word_end, Double_.NaN);
|
||||
if (!Double_.IsNaN(word_val)) {
|
||||
if (word_idx > 2) {error = -4; return;}
|
||||
switch (word_idx) {
|
||||
@@ -271,9 +271,9 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
}
|
||||
private static final byte Dir_unknown_id = 0, Dir_lat_id = 1, Dir_long_id = 2;
|
||||
public static final byte[] Dir_lat_bry = Bry_.new_a7("lat"), Dir_long_bry = Bry_.new_a7("long");
|
||||
private static final Btrie_slim_mgr Dir_trie = Btrie_slim_mgr.ci_ascii_() // NOTE:ci.ascii:MW_const.en
|
||||
.Add_bry_bval(Dir_lat_bry , Dir_lat_id)
|
||||
.Add_bry_bval(Dir_long_bry , Dir_long_id)
|
||||
private static final Btrie_slim_mgr Dir_trie = Btrie_slim_mgr.ci_a7() // NOTE:ci.ascii:MW_const.en
|
||||
.Add_bry_byte(Dir_lat_bry , Dir_lat_id)
|
||||
.Add_bry_byte(Dir_long_bry , Dir_long_id)
|
||||
;
|
||||
private static final byte[]
|
||||
Compass_N = new byte[] {Byte_ascii.Ltr_N}
|
||||
@@ -286,7 +286,7 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
private static final byte[] Input_units = new byte[] {Input_byte_degree, Byte_ascii.Apos, Byte_ascii.Quote, Byte_ascii.Space};
|
||||
private static final int Input_units_len = Input_units.length;
|
||||
private static final byte[] Input_bry_degree = Bry_.new_u8("°");
|
||||
private static final Btrie_slim_mgr Input_trie = Btrie_slim_mgr.cs_()
|
||||
private static final Btrie_slim_mgr Input_trie = Btrie_slim_mgr.cs()
|
||||
.Add_str_byte("'" , Input_tid_apos) // NOTE: must add ' so that "'" -> "' "
|
||||
.Add_str_byte("‘" , Input_tid_apos)
|
||||
.Add_str_byte("’" , Input_tid_apos)
|
||||
@@ -304,7 +304,7 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
.Add_str_byte("\t" , Input_tid_space)
|
||||
.Add_str_byte("\n" , Input_tid_space)
|
||||
.Add_str_byte("\r" , Input_tid_space)
|
||||
.Add_bry_bval(Input_bry_degree , Input_tid_degree)
|
||||
.Add_bry_byte(Input_bry_degree , Input_tid_degree)
|
||||
.Add_str_byte("N" , Input_tid_compass)
|
||||
.Add_str_byte("S" , Input_tid_compass)
|
||||
.Add_str_byte("E" , Input_tid_compass)
|
||||
|
||||
Reference in New Issue
Block a user