Skip to content

Commit

Permalink
update comments for some old date parsing methods for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Dec 11, 2015
1 parent 96d7b69 commit 949db40
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/stanford-mods/origin_info.rb
Expand Up @@ -155,6 +155,7 @@ def get_bc_year dates

# get a single digit century like '9th century' from the date array
# @param [Array<String>] dates an array of potential year strings
# @return [String] y-- if we identify century digit in string
def get_single_digit_century dates
dates.each do |f_date|
matches = f_date.scan(/\d{1}th/)
Expand All @@ -180,6 +181,7 @@ def get_single_digit_century dates

# get a double digit century like '12th century' from the date array
# @param [Array<String>] dates an array of potential year strings
# @return [String] yy-- if we identify century digits in string
def get_double_digit_century dates
dates.each do |f_date|
matches=f_date.scan(/\d{2}th/)
Expand All @@ -203,9 +205,10 @@ def get_double_digit_century dates
nil
end

# If a year has a "u" in it, replace instances of u with 0
# @param [String] dates
# @return String
# If a year has a "u" in it, replace u with 0 for yyyu (becomes yyy0)
# and replace u with '-' for yyuu (becomes yy--)
# @param [String] dates looking for matches on yyyu or yyuu in these strings
# @return [String, nil] String of format yyy0 or yy--, or nil
def get_u_year dates
dates.each do |f_date|
# Single digit u notation
Expand Down

0 comments on commit 949db40

Please sign in to comment.