class Mathml2latex::XsltFunctions

Public Instance Methods

fetch_symbols(str) click to toggle source
# File lib/mathml2latex/xslt_functions.rb, line 20
def fetch_symbols(str)
  ret_str = ''.dup
  str.each_char do |character|
    key = character.chr.ord
    val = Mathml2latex::SYMBOLS[key]
    val = character if val.nil?
    ret_str << val
  end
  ret_str
end
matches(str, regex_str, flag = '') click to toggle source
# File lib/mathml2latex/xslt_functions.rb, line 14
def matches(str, regex_str, flag = '')
  str.downcase! if flag == 'i'
  regex = Regexp.new(regex_str)
  !(str =~ regex).nil?
end
replace(str, regex_str, replacement) click to toggle source
# File lib/mathml2latex/xslt_functions.rb, line 9
def replace(str, regex_str, replacement)
  regex = Regexp.new(regex_str)
  str.gsub(regex, replacement)
end