module Researchmap2bib::Utils
Public Instance Methods
family_name(author)
click to toggle source
# File lib/researchmap2bib/utils.rb, line 21 def family_name(author) if /(^\w*) +(\w*)$/ =~ author $2 elsif /(^\S*) +(\S*)$/ =~ author $1 else author end end
to_hankaku(str)
click to toggle source
# File lib/researchmap2bib/utils.rb, line 4 def to_hankaku(str) str.tr('0-9a-zA-Z,、 ', '0-9a-zA-Z,, ') end
year_month(date)
click to toggle source
# File lib/researchmap2bib/utils.rb, line 8 def year_month(date) /([0-9]{4})([0-9]{2})/.match(date).captures end