class WirisPlugin::WCharacterBase

Constants

ALIGNMENT_MARK
ALIGNMENT_RELATION_OPERATORS
ARABIC_DECIMAL_SEPARATOR
ARABIC_THOUSANDS_SEPARATOR
BACKSLASH
BOTTOM_CURLY_BRACKET
BOTTOM_HALF_INTEGRAL
BOTTOM_PARENTHESIS
BOTTOM_SQUARE_BRACKET
CARON
CARRIAGE_RETURN
CIRCUMFLEX_ACCENT
COMBINING_LOW_LINE
COMMA
CURLY_BRACKET_LEFT
CURLY_BRACKET_RIGHT
DIGIT_NINE
DIGIT_ZERO
DOT_ABOVE
DOUBLE_HORIZONTAL_BAR
DOUBLE_STRUCK_ITALIC_CAPITAL_D
DOUBLE_STRUCK_ITALIC_SMALL_D
DOUBLE_STRUCK_ITALIC_SMALL_E
DOUBLE_STRUCK_ITALIC_SMALL_I
DOUBLE_VERTICAL_BAR
DOWNWARDS_ARROW
EM_QUAD
EM_SPACE
EN_QUAD
EN_SPACE
EPSILON
FIGIRE_SPACE
FULL_STOP
HAIR_SPACE
HORIZONTAL_TAB
INTEGRAL
INTEGRAL_EXTENSION
LATIN_CAPITAL_LETTER_A
LATIN_CAPITAL_LETTER_Z
LATIN_SMALL_LETTER_A
LATIN_SMALL_LETTER_Z
LEFTRIGHT_ARROW
LEFTWARDS_ARROW
LEFTWARDS_ARROW_FROM_BAR
LEFTWARDS_ARROW_OVER_RIGHTWARDS_ARROW
LEFTWARDS_ARROW_WITH_HOOK
LEFTWARDS_DOUBLE_ARROW
LEFTWARDS_HARPOON_OVER_RIGHTWARDS_HARPOON
LEFTWARDS_HARPOON_WITH_BARB_UPWARDS
LEFT_CEILING
LEFT_FLOOR
LEFT_RIGHT_DOUBLE_ARROW
LETTER_CATEGORY
LINE
LINE_FEED
LONG_LEFTWARDS_ARROW
LONG_LEFTWARDS_DOUBLE_ARROW
LONG_LEFT_RIGHT_ARROW
LONG_LEFT_RIGHT_DOUBLE_ARROW
LONG_RIGHTWARDS_ARROW
LONG_RIGHTWARDS_DOUBLE_ARROW
LOW_LINE
MACRON
MARK_CATEGORY
MATHEMATICAL_DOUBLE_STRUCK_CAPITAL_A
MATHEMATICAL_DOUBLE_STRUCK_DIGIT_ZERO
MATHEMATICAL_DOUBLE_STRUCK_SMALL_A
MATHEMATICAL_FRAKTUR_CAPITAL_A
MATHEMATICAL_FRAKTUR_SMALL_A
MATHEMATICAL_LEFT_ANGLE_BRACKET
MATHEMATICAL_RIGHT_ANGLE_BRACKET
MATHEMATICAL_SCRIPT_CAPITAL_A
MATHEMATICAL_SCRIPT_SMALL_A
MEDIUM_MATHEMATICAL_SPACE
MIDDLE_DOT
MID_SPACE
MODIFIER_LETTER_CIRCUMFLEX_ACCENT
NARROW_NO_BREAK_SPACE
NEGATIVE_THIN_SPACE
NO_BREAK_SPACE
NUMBER_CATEGORY
NUMBER_SIGN
OTHER_CATEGORY
PHONETICAL_CATEGORY
PLANCKOVER2PI
PUNCTUATION_CATEGORY
PUNCTUATION_SPACE
RIGHTWARDS_ARROW
RIGHTWARDS_ARROW_ABOVE_SHORT_LEFTWARDS_ARROW
RIGHTWARDS_ARROW_FROM_BAR
RIGHTWARDS_ARROW_OVER_LEFTWARDS_ARROW
RIGHTWARDS_ARROW_WITH_HOOK
RIGHTWARDS_DOUBLE_ARROW
RIGHTWARDS_HARPOON_OVER_LEFTWARDS_HARPOON
RIGHTWARDS_HARPOON_WITH_BARB_UPWARDS
RIGHT_CEILING
RIGHT_FLOOR
ROOT
ROOT_LEFT_TAIL
ROOT_NO_TAIL
ROOT_NO_TAIL_VERTICAL
ROOT_VERTICAL
ROOT_VERTICAL_LINE
ROUND_BRACKET_LEFT
ROUND_BRACKET_RIGHT
SEGMENT
SHORT_RIGHTWARDS_ARROW_ABOVE_LEFTWARDS_ARROW
SIX_PER_EM_SPACE
SPACE
SQUARE_BRACKET_LEFT
SQUARE_BRACKET_RIGHT
SYMBOL_CATEGORY
THICK_SPACE
THIN_SPACE
TILDE
TILDE_OPERATOR
TOP_CURLY_BRACKET
TOP_HALF_INTEGRAL
TOP_PARENTHESIS
TOP_SQUARE_BRACKET
UNICODES_WITH_CATEGORIES
UPWARDS_ARROW
UP_DOWN_ARROW
VAREPSILON
VERTICAL_BAR
VERTICAL_LINE_EXTENSION
WORD_JOINER
ZERO_WIDTH_JOINER
ZERO_WIDTH_NON_JOINER
ZERO_WIDTH_SPACE

Public Class Methods

accentsDictionary() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 244
def self.accentsDictionary
    @@accentsDictionary
end
accentsDictionary=(accentsDictionary) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 247
def self.accentsDictionary=(accentsDictionary)
    @@accentsDictionary = accentsDictionary
end
binaryOps() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 181
def self.binaryOps
    @@binaryOps
end
binaryOps=(binaryOps) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 184
def self.binaryOps=(binaryOps)
    @@binaryOps = binaryOps
end
binarySearch(v, c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 161
def self.binarySearch(v, c)
    min = 0
    max = v::length - 1
    loop do
        mid = ((min + max)/2)
        cc = v[mid]
        if c == cc
            return true
        else 
            if c < cc
                max = mid - 1
            else 
                min = mid + 1
            end
        end
    break if not min <= max
    end
    return false
end
getCategoriesUnicode() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 365
def self.getCategoriesUnicode()
    categoriesUnicode = Hash.new()
    categoriesUnicode::set(SYMBOL_CATEGORY,"SymbolUnicodeCategory")
    categoriesUnicode::set(PUNCTUATION_CATEGORY,"PunctuationUnicodeCategory")
    categoriesUnicode::set(LETTER_CATEGORY,"LetterUnicodeCategory")
    categoriesUnicode::set(MARK_CATEGORY,"MarkUnicodeCategory")
    categoriesUnicode::set(NUMBER_CATEGORY,"NumberUnicodeCategory")
    categoriesUnicode::set(PHONETICAL_CATEGORY,"PhoneticalUnicodeCategory")
    categoriesUnicode::set(OTHER_CATEGORY,"OtherUnicodeCategory")
    return categoriesUnicode
end
getMirror(str) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 416
def self.getMirror(str)
    mirroredStr = ""
    i = 0
    while i < str::length()
        c = Std::charCodeAt(str,i)
        j = 0
        while j < WCharacterBase::mirrorDictionary::length
            if c == WCharacterBase::mirrorDictionary[j]
                c = WCharacterBase::mirrorDictionary[j + 1]
                break
            end
            j += 2
        end
        mirroredStr += Std::fromCharCode(c)
        i+=1
    end
    return mirroredStr
end
getNegated(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 444
def self.getNegated(c)
    i = 0
    while i < WCharacterBase::negations::length
        if WCharacterBase::negations[i] == c
            return WCharacterBase::negations[i + 1]
        end
        i += 2
    end
    return -1
end
getNotNegated(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 454
def self.getNotNegated(c)
    i = 1
    while i < WCharacterBase::negations::length
        if WCharacterBase::negations[i] == c
            return WCharacterBase::negations[i - 1]
        end
        i += 2
    end
    return -1
end
getUnicodeCategoryList(category) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 376
def self.getUnicodeCategoryList(category)
    indexStart = UNICODES_WITH_CATEGORIES::indexOf(("@" + category) + ":")
    unicodes = Std::substr(UNICODES_WITH_CATEGORIES,indexStart + 3)
    indexEnd = unicodes::indexOf("@")
    unicodes = Std::substr(unicodes,0,indexEnd)
    return WCharacterBase.getUnicodesRangedStringList(unicodes)
end
getUnicodesRangedStringList(unicodesRangedList) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 383
def self.getUnicodesRangedStringList(unicodesRangedList)
    inputList = Std::split(unicodesRangedList,",")
    unicodeList = Array.new()
    i = 0
    while i < inputList::length()
        actual_range = inputList::_(i)
        actual_range = StringTools::replace(actual_range," ","")
        if actual_range::indexOf("-") != -1
            firstRangeValueHex = WCharacterBase.hexStringToUnicode(Std::split(actual_range,"-")::_(0))
            lastRangeValueHex = WCharacterBase.hexStringToUnicode(Std::split(actual_range,"-")::_(1))
            actualValue = firstRangeValueHex
            while actualValue <= lastRangeValueHex
                unicodeList::push(Utf8::uchr(actualValue))
                actualValue+=1
            end
        else 
            actualValue = WCharacterBase.hexStringToUnicode(actual_range)
            unicodeList::push(Utf8::uchr(actualValue))
        end
        i+=1
    end
    return unicodeList
end
greek2Latin(g) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 703
def self.greek2Latin(g)
    index = -1
    if g < 100
        index = WCharacterBase::greekLetters::indexOf(("@00" + g.to_s) + "@")
    else 
        if g < 1000
            index = WCharacterBase::greekLetters::indexOf(("@0" + g.to_s) + "@")
        else 
            index = WCharacterBase::greekLetters::indexOf(("@" + g.to_s) + "@")
        end
    end
    if index != -1
        s = Std::substr(WCharacterBase::latinLetters,index + 1,4)
        return Std::parseInt(s)
    end
    return g
end
greekLetters() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 680
def self.greekLetters
    @@greekLetters
end
greekLetters=(greekLetters) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 683
def self.greekLetters=(greekLetters)
    @@greekLetters = greekLetters
end
hexStringToUnicode(unicode) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 406
def self.hexStringToUnicode(unicode)
    return Std::parseInt("0x" + unicode)
end
horizontalLTRStretchyChars() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 344
def self.horizontalLTRStretchyChars
    @@horizontalLTRStretchyChars
end
horizontalLTRStretchyChars=(horizontalLTRStretchyChars) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 347
def self.horizontalLTRStretchyChars=(horizontalLTRStretchyChars)
    @@horizontalLTRStretchyChars = horizontalLTRStretchyChars
end
horizontalOperators() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 663
def self.horizontalOperators
    @@horizontalOperators
end
horizontalOperators=(horizontalOperators) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 666
def self.horizontalOperators=(horizontalOperators)
    @@horizontalOperators = horizontalOperators
end
initAccentsDictionary() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 250
def self.initAccentsDictionary()
    if @@accentsDictionary != nil
        return 
    end
    h = Hash.new()
    h::set("A",[192, 193, 194, 195, 196, 197, 256, 258, 260, 461, 478, 480, 506, 512, 514, 550, 570, 7680, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856, 7858, 7860, 7862, 9398, 11375, 65313])
    h::set("AA",[42802])
    h::set("AE",[198, 482, 508])
    h::set("AO",[42804])
    h::set("AU",[42806])
    h::set("AV",[42808, 42810])
    h::set("AY",[42812])
    h::set("B",[385, 386, 579, 7682, 7684, 7686, 9399, 65314])
    h::set("C",[199, 262, 264, 266, 268, 391, 571, 7688, 9400, 42814, 65315])
    h::set("D",[208, 270, 272, 393, 394, 395, 7690, 7692, 7694, 7696, 7698, 9401, 42873, 65316])
    h::set("DZ",[452, 497])
    h::set("Dz",[453, 498])
    h::set("E",[200, 201, 202, 203, 274, 276, 278, 280, 282, 398, 400, 516, 518, 552, 7700, 7702, 7704, 7706, 7708, 7864, 7866, 7868, 7870, 7872, 7874, 7876, 7878, 9402, 65317])
    h::set("F",[401, 7710, 9403, 42875, 65318])
    h::set("G",[284, 286, 288, 290, 403, 484, 486, 500, 7712, 9404, 42877, 42878, 42912, 65319])
    h::set("H",[292, 294, 542, 7714, 7716, 7718, 7720, 7722, 9405, 11367, 11381, 42893, 65320])
    h::set("I",[204, 205, 206, 207, 296, 298, 300, 302, 304, 407, 463, 520, 522, 7724, 7726, 7880, 7882, 9406, 65321])
    h::set("J",[308, 584, 9407, 65322])
    h::set("K",[310, 408, 488, 7728, 7730, 7732, 9408, 11369, 42816, 42818, 42820, 42914, 65323])
    h::set("L",[313, 315, 317, 319, 321, 573, 7734, 7736, 7738, 7740, 9409, 11360, 11362, 42822, 42824, 42880, 65324])
    h::set("LJ",[455])
    h::set("Lj",[456])
    h::set("M",[412, 7742, 7744, 7746, 9410, 11374, 65325])
    h::set("N",[209, 323, 325, 327, 413, 504, 544, 7748, 7750, 7752, 7754, 9411, 42896, 42916, 65326])
    h::set("NJ",[458])
    h::set("Nj",[459])
    h::set("O",[210, 211, 212, 213, 214, 216, 332, 334, 336, 390, 415, 416, 465, 490, 492, 510, 524, 526, 554, 556, 558, 560, 7756, 7758, 7760, 7762, 7884, 7886, 7888, 7890, 7892, 7894, 7896, 7898, 7900, 7902, 7904, 7906, 9412, 42826, 42828, 65327])
    h::set("OI",[418])
    h::set("OO",[42830])
    h::set("OU",[546])
    h::set("OE",[140, 338])
    h::set("oe",[156, 339])
    h::set("P",[420, 7764, 7766, 9413, 11363, 42832, 42834, 42836, 65328])
    h::set("Q",[586, 9414, 42838, 42840, 65329])
    h::set("R",[340, 342, 344, 528, 530, 588, 7768, 7770, 7772, 7774, 9415, 11364, 42842, 42882, 42918, 65330])
    h::set("S",[346, 348, 350, 352, 536, 7776, 7778, 7780, 7782, 7784, 7838, 9416, 11390, 42884, 42920, 65331])
    h::set("T",[354, 356, 358, 428, 430, 538, 574, 7786, 7788, 7790, 7792, 9417, 42886, 65332])
    h::set("TZ",[42792])
    h::set("U",[217, 218, 219, 220, 360, 362, 364, 366, 368, 370, 431, 467, 469, 471, 473, 475, 532, 534, 580, 7794, 7796, 7798, 7800, 7802, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 9418, 65333])
    h::set("V",[434, 581, 7804, 7806, 9419, 42846, 65334])
    h::set("VY",[42848])
    h::set("W",[372, 7808, 7810, 7812, 7814, 7816, 9420, 11378, 65335])
    h::set("X",[7818, 7820, 9421, 65336])
    h::set("Y",[221, 374, 376, 435, 562, 590, 7822, 7922, 7924, 7926, 7928, 7934, 9422, 65337])
    h::set("Z",[377, 379, 381, 437, 548, 7824, 7826, 7828, 9423, 11371, 11391, 42850, 65338])
    h::set("a",[224, 225, 226, 227, 228, 229, 257, 259, 261, 462, 479, 481, 507, 513, 515, 551, 592, 7681, 7834, 7841, 7843, 7845, 7847, 7849, 7851, 7853, 7855, 7857, 7859, 7861, 7863, 9424, 11365, 65345])
    h::set("aa",[42803])
    h::set("ae",[230, 483, 509])
    h::set("ao",[42805])
    h::set("au",[42807])
    h::set("av",[42809, 42811])
    h::set("ay",[42813])
    h::set("b",[384, 387, 595, 7683, 7685, 7687, 9425, 65346])
    h::set("c",[231, 263, 265, 267, 269, 392, 572, 7689, 8580, 9426, 42815, 65347])
    h::set("d",[271, 273, 396, 598, 599, 7691, 7693, 7695, 7697, 7699, 9427, 42874, 65348])
    h::set("dz",[454, 499])
    h::set("e",[232, 233, 234, 235, 275, 277, 279, 281, 283, 477, 517, 519, 553, 583, 603, 7701, 7703, 7705, 7707, 7709, 7865, 7867, 7869, 7871, 7873, 7875, 7877, 7879, 9428, 65349])
    h::set("f",[402, 7711, 9429, 42876, 65350])
    h::set("g",[285, 287, 289, 291, 485, 487, 501, 608, 7545, 7713, 9430, 42879, 42913, 65351])
    h::set("h",[293, 295, 543, 613, 7715, 7717, 7719, 7721, 7723, 7830, 9431, 11368, 11382, 65352])
    h::set("hv",[405])
    h::set("i",[236, 237, 238, 239, 297, 299, 301, 303, 305, 464, 521, 523, 616, 7725, 7727, 7881, 7883, 9432, 65353])
    h::set("j",[309, 496, 585, 9433, 65354])
    h::set("k",[311, 409, 489, 7729, 7731, 7733, 9434, 11370, 42817, 42819, 42821, 42915, 65355])
    h::set("l",[314, 316, 318, 320, 322, 383, 410, 619, 7735, 7737, 7739, 7741, 9435, 11361, 42823, 42825, 42881, 65356])
    h::set("lj",[457])
    h::set("m",[623, 625, 7743, 7745, 7747, 9436, 65357])
    h::set("n",[241, 324, 326, 328, 329, 414, 505, 626, 7749, 7751, 7753, 7755, 9437, 42897, 42917, 65358])
    h::set("nj",[460])
    h::set("o",[242, 243, 244, 245, 246, 248, 333, 335, 337, 417, 466, 491, 493, 511, 525, 527, 555, 557, 559, 561, 596, 629, 7757, 7759, 7761, 7763, 7885, 7887, 7889, 7891, 7893, 7895, 7897, 7899, 7901, 7903, 7905, 7907, 9438, 42827, 42829, 65359])
    h::set("oi",[419])
    h::set("ou",[547])
    h::set("oo",[42831])
    h::set("p",[421, 7549, 7765, 7767, 9439, 42833, 42835, 42837, 65360])
    h::set("q",[587, 9440, 42839, 42841, 65361])
    h::set("r",[341, 343, 345, 529, 531, 589, 637, 7769, 7771, 7773, 7775, 9441, 42843, 42883, 42919, 65362])
    h::set("s",[223, 347, 349, 351, 353, 537, 575, 7777, 7779, 7781, 7783, 7785, 7835, 9442, 42885, 42921, 65363])
    h::set("t",[355, 357, 359, 429, 539, 648, 7787, 7789, 7791, 7793, 7831, 9443, 11366, 42887, 65364])
    h::set("tz",[42793])
    h::set("u",[249, 250, 251, 252, 361, 363, 365, 367, 369, 371, 432, 468, 470, 472, 474, 476, 533, 535, 649, 7795, 7797, 7799, 7801, 7803, 7909, 7911, 7913, 7915, 7917, 7919, 7921, 9444, 65365])
    h::set("v",[651, 652, 7805, 7807, 9445, 42847, 65366])
    h::set("vy",[42849])
    h::set("w",[373, 7809, 7811, 7813, 7815, 7817, 7832, 9446, 11379, 65367])
    h::set("x",[7819, 7821, 9447, 65368])
    h::set("y",[253, 255, 375, 436, 563, 591, 7823, 7833, 7923, 7925, 7927, 7929, 7935, 9448, 65369])
    h::set("z",[378, 380, 382, 438, 549, 576, 7825, 7827, 7829, 9449, 11372, 42851, 65370])
    @@accentsDictionary = h
end
invisible() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 410
def self.invisible
    @@invisible
end
invisible=(invisible) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 413
def self.invisible=(invisible)
    @@invisible = invisible
end
isArabian(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 540
def self.isArabian(c)
    if ((c >= 1536) && (c <= 1791)) && !WCharacterBase::isDigit(c)
        return true
    end
    return false
end
isArabianString(s) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 530
def self.isArabianString(s)
    i = s::length() - 1
    while i >= 0
        if !WCharacterBase.isArabian(Std::charCodeAt(s,i))
            return false
        end
        i-=1
    end
    return true
end
isBinaryOp(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 155
def self.isBinaryOp(c)
    return WCharacterBase.binarySearch(binaryOps,c)
end
isChinese(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 552
def self.isChinese(c)
    if (c >= 13312) && (c <= 40959)
        return true
    end
    return false
end
isCombining(s) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 464
def self.isCombining(s)
    it = Utf8::getIterator(s)
    while it::hasNext()
        if !WCharacterBase::isCombiningCharacter(it::next())
            return false
        end
    end
    return true
end
isCombiningCharacter(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 473
def self.isCombiningCharacter(c)
    return (((c >= 768) && (c <= 879)) || ((c >= 6832) && (c <= 6911))) || ((((c >= 7616) && (c <= 7679)) && ((c >= 8400) && (c <= 8447))) && ((c >= 65056) && (c <= 65071)))
end
isDevanagari(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 578
def self.isDevanagari(c)
    if (c >= 2304) && (c < 2431)
        return true
    end
    return false
end
isDevanagariString(s) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 596
def self.isDevanagariString(s)
    i = s::length() - 1
    while i >= 0
        if !WCharacterBase.isDevanagari(Std::charCodeAt(s,i))
            return false
        end
        i-=1
    end
    return true
end
isDigit(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 131
def self.isDigit(c)
    if (48 <= c) && (c <= 57)
        return true
    end
    if (1632 <= c) && (c <= 1641)
        return true
    end
    if (1776 <= c) && (c <= 1785)
        return true
    end
    if (2790 <= c) && (c <= 2799)
        return true
    end
    return false
end
isDisplayedWithStix(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 733
def self.isDisplayedWithStix(c)
    if (c >= 592) && (c <= 687)
        return true
    end
    if (c >= 688) && (c <= 767)
        return true
    end
    if ((c >= 8215) && (c <= 8233)) || ((c >= 8241) && (c <= 8303))
        return true
    end
    if (c >= 8304) && (c <= 8351)
        return true
    end
    if (c >= 8400) && (c <= 8447)
        return true
    end
    if (c >= 8448) && (c <= 8527)
        return true
    end
    if (c >= 8528) && (c <= 8591)
        return true
    end
    if (c >= 8592) && (c <= 8703)
        return true
    end
    if (c >= 8704) && (c <= 8959)
        return true
    end
    if (c >= 8960) && (c <= 9215)
        return true
    end
    if (c >= 9312) && (c <= 9471)
        return true
    end
    if (c >= 9472) && (c <= 9599)
        return true
    end
    if (c >= 9600) && (c <= 9631)
        return true
    end
    if (c >= 9632) && (c <= 9727)
        return true
    end
    if (c >= 9728) && (c <= 9983)
        return true
    end
    if (c >= 9984) && (c <= 10175)
        return true
    end
    if (c >= 10176) && (c <= 10223)
        return true
    end
    if (c >= 10224) && (c <= 10239)
        return true
    end
    if (c >= 10240) && (c <= 10495)
        return true
    end
    if (c >= 10496) && (c <= 10623)
        return true
    end
    if (c >= 10624) && (c <= 10751)
        return true
    end
    if (c >= 10752) && (c <= 11007)
        return true
    end
    if (c >= 11008) && (c <= 11263)
        return true
    end
    if (c >= 12288) && (c <= 12351)
        return true
    end
    if (c >= 57344) && (c <= 65535)
        return true
    end
    if ((c >= 119808) && (c <= 119963)) || ((c >= 120224) && (c <= 120831))
        return true
    end
    if ((c == 12398) || (c == 42791)) || (c == 42898)
        return true
    end
    return false
end
isDoubleStruck(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 512
def self.isDoubleStruck(c)
    return (((((((((c >= 120120) && (c <= 120171)) || (c == 8450)) || (c == 8461)) || (c == 8469)) || (c == 8473)) || (c == 8474)) || (c == 8477)) || (c == 8484))
end
isFraktur(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 515
def self.isFraktur(c)
    return (((((((c >= 120068) && (c <= 120119)) || (c == 8493)) || (c == 8460)) || (c == 8465)) || (c == 8476)) || (c == 8488))
end
isGreek(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 564
def self.isGreek(c)
    if (c >= 945) && (c <= 969)
        return true
    else 
        if ((c >= 913) && (c <= 937)) && (c != 930)
            return true
        else 
            if ((c == 977) || (c == 981)) || (c == 982)
                return true
            end
        end
    end
    return false
end
isGujarati(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 584
def self.isGujarati(c)
    if (((c >= 2689) && (c < 2788)) || (c == 2800)) || (c == 2801)
        return true
    end
    return false
end
isHebrew(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 546
def self.isHebrew(c)
    if (c >= 1424) && (c <= 1535)
        return true
    end
    return false
end
isHorizontalOperator(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 669
def self.isHorizontalOperator(c)
    return WCharacterBase.binarySearch(@@horizontalOperators,c)
end
isIdentifier(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 146
def self.isIdentifier(c)
    return (WCharacterBase.isLetter(c) || WCharacterBase.isCombiningCharacter(c)) || (c == 95)
end
isInvisible(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 659
def self.isInvisible(c)
    return WCharacterBase.binarySearch(@@invisible,c)
end
isKorean(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 558
def self.isKorean(c)
    if (c >= 12593) && (c <= 52044)
        return true
    end
    return false
end
isLTRNumber(text) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 628
def self.isLTRNumber(text)
    i = 0
    n = Utf8::getLength(text)
    while i < n
        if !WCharacterBase::isDigit(Utf8::charCodeAt(text,i))
            return false
        end
        i+=1
    end
    return true
end
isLarge(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 149
def self.isLarge(c)
    return WCharacterBase.binarySearch(largeOps,c)
end
isLetter(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 476
def self.isLetter(c)
    if WCharacterBase.isDigit(c)
        return false
    end
    if (65 <= c) && (c <= 90)
        return true
    end
    if (97 <= c) && (c <= 122)
        return true
    end
    if (((192 <= c) && (c <= 696)) && (c != 215)) && (c != 247)
        return true
    end
    if (867 <= c) && (c <= 1521)
        return true
    end
    if (1552 <= c) && (c <= 8188)
        return true
    end
    if ((((c == 8472) || (c == 8467)) || WCharacterBase.isDoubleStruck(c)) || WCharacterBase.isFraktur(c)) || WCharacterBase.isScript(c)
        return true
    end
    if WCharacterBase.isChinese(c)
        return true
    end
    if WCharacterBase.isKorean(c)
        return true
    end
    return false
end
isLongLetter(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 618
def self.isLongLetter(c)
    if ((97 <= c) && (c <= 122)) || ((945 <= c) && (c <= 969))
        return (WCharacterBase::binarySearch(@@longLetters,c))
    else 
        if (65 <= c) && (c <= 90)
            return false
        end
    end
    return true
end
isLowerCase(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 521
def self.isLowerCase(c)
    return (((((c >= 97) && (c <= 122)) || ((c >= 224) && (c <= 255))) || ((c >= 591) && (c >= 659))) || ((c >= 661) && (c <= 687))) || ((c >= 940) && (c <= 974))
end
isOp(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 720
def self.isOp(c)
    return (((((WCharacterBase.isLarge(c) || WCharacterBase.isVeryLarge(c)) || WCharacterBase.isBinaryOp(c)) || WCharacterBase.isRelation(c)) || (c == Std::charCodeAt(".",0))) || (c == Std::charCodeAt(",",0))) || (c == Std::charCodeAt(":",0))
end
isRTL(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 606
def self.isRTL(c)
    if WCharacterBase.isHebrew(c) || WCharacterBase.isArabian(c)
        return true
    end
    return false
end
isRelation(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 158
def self.isRelation(c)
    return WCharacterBase.binarySearch(relations,c)
end
isRequiredByQuizzes(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 509
def self.isRequiredByQuizzes(c)
    return ((((((((c == 120128) || (c == 8450)) || (c == 8461)) || (c == 8469)) || (c == 8473)) || (c == 8474)) || (c == 8477)) || (c == 8484))
end
isScript(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 518
def self.isScript(c)
    return (((((((((((((c >= 119964) && (c <= 120015)) || (c == 8458)) || (c == 8459)) || (c == 8466)) || (c == 8464)) || (c == 8499)) || (c == 8500)) || (c == 8492)) || (c == 8495)) || (c == 8496)) || (c == 8497)) || (c == 8475))
end
isStretchyLTR(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 434
def self.isStretchyLTR(c)
    i = 0
    while i < WCharacterBase::horizontalLTRStretchyChars::length
        if c == WCharacterBase::horizontalLTRStretchyChars[i]
            return true
        end
        i+=1
    end
    return false
end
isSubscript(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 642
def self.isSubscript(c)
    return ((c >= 8320) && (c <= 8348)) && (c != 8335)
end
isSuperscript(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 639
def self.isSuperscript(c)
    return (((c == 178) || (c == 179)) || (c == 185)) || ((((c >= 8304) && (c <= 8319)) && (c != 8306)) && (c != 8307))
end
isSuperscriptOrSubscript(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 645
def self.isSuperscriptOrSubscript(c)
    return WCharacterBase.isSuperscript(c) || WCharacterBase.isSubscript(c)
end
isTallAccent(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 723
def self.isTallAccent(c)
    i = 0
    while i < WCharacterBase::tallAccents::length
        if c == WCharacterBase::tallAccents[i]
            return true
        end
        i+=1
    end
    return false
end
isTallLetter(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 612
def self.isTallLetter(c)
    if ((97 <= c) && (c <= 122)) || ((945 <= c) && (c <= 969))
        return (WCharacterBase::binarySearch(@@tallLetters,c))
    end
    return true
end
isThai(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 590
def self.isThai(c)
    if (3585 <= c) && (c < 3676)
        return true
    end
    return false
end
isUnicodeMathvariant(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 506
def self.isUnicodeMathvariant(c)
    return ((WCharacterBase.isDoubleStruck(c) || WCharacterBase.isFraktur(c)) || WCharacterBase.isScript(c))
end
isVeryLarge(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 152
def self.isVeryLarge(c)
    return WCharacterBase.binarySearch(veryLargeOps,c)
end
isWord(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 524
def self.isWord(c)
    if ((((WCharacterBase.isDevanagari(c) || WCharacterBase.isChinese(c)) || WCharacterBase.isHebrew(c)) || WCharacterBase.isThai(c)) || WCharacterBase.isGujarati(c)) || WCharacterBase.isKorean(c)
        return true
    end
    return false
end
largeOps() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 195
def self.largeOps
    @@largeOps
end
largeOps=(largeOps) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 198
def self.largeOps=(largeOps)
    @@largeOps = largeOps
end
latin2Greek(l) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 686
def self.latin2Greek(l)
    index = -1
    if l < 100
        index = WCharacterBase::latinLetters::indexOf(("@00" + l.to_s) + "@")
    else 
        if l < 1000
            index = WCharacterBase::latinLetters::indexOf(("@0" + l.to_s) + "@")
        else 
            index = WCharacterBase::latinLetters::indexOf(("@" + l.to_s) + "@")
        end
    end
    if index != -1
        s = Std::substr(WCharacterBase::greekLetters,index + 1,4)
        return Std::parseInt(s)
    end
    return l
end
latinLetters() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 673
def self.latinLetters
    @@latinLetters
end
latinLetters=(latinLetters) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 676
def self.latinLetters=(latinLetters)
    @@latinLetters = latinLetters
end
latinToDoublestruck(codepoint) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 817
def self.latinToDoublestruck(codepoint)
    if codepoint == 67
        return 8450
    else 
        if codepoint == 72
            return 8461
        else 
            if codepoint == 78
                return 8469
            else 
                if codepoint == 80
                    return 8473
                else 
                    if codepoint == 81
                        return 8474
                    else 
                        if codepoint == 82
                            return 8477
                        else 
                            if codepoint == 90
                                return 8484
                            else 
                                if (codepoint >= LATIN_CAPITAL_LETTER_A) && (codepoint <= LATIN_CAPITAL_LETTER_Z)
                                    return codepoint + (MATHEMATICAL_DOUBLE_STRUCK_CAPITAL_A - LATIN_CAPITAL_LETTER_A)
                                else 
                                    if (codepoint >= LATIN_SMALL_LETTER_A) && (codepoint <= LATIN_SMALL_LETTER_Z)
                                        return codepoint + (MATHEMATICAL_DOUBLE_STRUCK_SMALL_A - LATIN_SMALL_LETTER_A)
                                    else 
                                        if (codepoint >= DIGIT_ZERO) && (codepoint <= DIGIT_NINE)
                                            return codepoint + (MATHEMATICAL_DOUBLE_STRUCK_DIGIT_ZERO - DIGIT_ZERO)
                                        else 
                                            return codepoint
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end
latinToFraktur(codepoint) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 915
def self.latinToFraktur(codepoint)
    if codepoint == 67
        return 8493
    else 
        if codepoint == 72
            return 8460
        else 
            if codepoint == 73
                return 8465
            else 
                if codepoint == 82
                    return 8476
                else 
                    if codepoint == 90
                        return 8488
                    else 
                        if (codepoint >= LATIN_CAPITAL_LETTER_A) && (codepoint <= LATIN_CAPITAL_LETTER_Z)
                            return codepoint + (MATHEMATICAL_FRAKTUR_CAPITAL_A - LATIN_CAPITAL_LETTER_A)
                        else 
                            if (codepoint >= LATIN_SMALL_LETTER_A) && (codepoint <= LATIN_SMALL_LETTER_Z)
                                return codepoint + (MATHEMATICAL_FRAKTUR_SMALL_A - LATIN_SMALL_LETTER_A)
                            else 
                                return codepoint
                            end
                        end
                    end
                end
            end
        end
    end
end
latinToScript(codepoint) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 860
def self.latinToScript(codepoint)
    if codepoint == 66
        return 8492
    else 
        if codepoint == 69
            return 8496
        else 
            if codepoint == 70
                return 8497
            else 
                if codepoint == 72
                    return 8459
                else 
                    if codepoint == 73
                        return 8464
                    else 
                        if codepoint == 76
                            return 8466
                        else 
                            if codepoint == 77
                                return 8499
                            else 
                                if codepoint == 82
                                    return 8475
                                else 
                                    if codepoint == 101
                                        return 8495
                                    else 
                                        if codepoint == 103
                                            return 8458
                                        else 
                                            if codepoint == 111
                                                return 8500
                                            else 
                                                if (codepoint >= LATIN_CAPITAL_LETTER_A) && (codepoint <= LATIN_CAPITAL_LETTER_Z)
                                                    return codepoint + (MATHEMATICAL_SCRIPT_CAPITAL_A - LATIN_CAPITAL_LETTER_A)
                                                else 
                                                    if (codepoint >= LATIN_SMALL_LETTER_A) && (codepoint <= LATIN_SMALL_LETTER_Z)
                                                        return codepoint + (MATHEMATICAL_SCRIPT_SMALL_A - LATIN_SMALL_LETTER_A)
                                                    else 
                                                        return codepoint
                                                    end
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end
longLetters() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 216
def self.longLetters
    @@longLetters
end
longLetters=(longLetters) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 219
def self.longLetters=(longLetters)
    @@longLetters = longLetters
end
mirrorDictionary() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 230
def self.mirrorDictionary
    @@mirrorDictionary
end
mirrorDictionary=(mirrorDictionary) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 233
def self.mirrorDictionary=(mirrorDictionary)
    @@mirrorDictionary = mirrorDictionary
end
negations() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 223
def self.negations
    @@negations
end
negations=(negations) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 226
def self.negations=(negations)
    @@negations = negations
end
new() click to toggle source
Calls superclass method
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 6
def initialize()
    super()
end
normalizeSubSuperScript(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 648
def self.normalizeSubSuperScript(c)
    i = 0
    n = @@subSuperScriptDictionary::length
    while i < n
        if @@subSuperScriptDictionary[i] == c
            return @@subSuperScriptDictionary[i + 1]
        end
        i += 2
    end
    return c
end
relations() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 188
def self.relations
    @@relations
end
relations=(relations) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 191
def self.relations=(relations)
    @@relations = relations
end
stripAccent(c) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 946
def self.stripAccent(c)
    WCharacterBase.initAccentsDictionary()
    if c >= 128
        i = @@accentsDictionary::keys()
        while i::hasNext()
            s = i::next()
            chars = @@accentsDictionary::get(s)
            if WCharacterBase.binarySearch(chars,c)
                return s
            end
        end
        return Utf8::uchr(c)
    else 
        return Std::fromCharCode(c)
    end
end
subSuperScriptDictionary() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 237
def self.subSuperScriptDictionary
    @@subSuperScriptDictionary
end
subSuperScriptDictionary=(subSuperScriptDictionary) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 240
def self.subSuperScriptDictionary=(subSuperScriptDictionary)
    @@subSuperScriptDictionary = subSuperScriptDictionary
end
tallAccents() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 351
def self.tallAccents
    @@tallAccents
end
tallAccents=(tallAccents) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 354
def self.tallAccents=(tallAccents)
    @@tallAccents = tallAccents
end
tallLetters() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 209
def self.tallLetters
    @@tallLetters
end
tallLetters=(tallLetters) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 212
def self.tallLetters=(tallLetters)
    @@tallLetters = tallLetters
end
veryLargeOps() click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 202
def self.veryLargeOps
    @@veryLargeOps
end
veryLargeOps=(veryLargeOps) click to toggle source
# File lib/com/wiris/util/xml/WCharacterBase.rb, line 205
def self.veryLargeOps=(veryLargeOps)
    @@veryLargeOps = veryLargeOps
end