Skip to content

Commit

Permalink
Changes to tag handling for wider odbl=clean catching and whitespace …
Browse files Browse the repository at this point in the history
…handling.
  • Loading branch information
zerebubuth committed Apr 24, 2012
1 parent 4be01a9 commit 14f7d76
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ def self.odbl_clean?(tags)
# special case for this one misspelling, as it's fairly
# common to find "obdl" and there's no chance that we're
# confusing "obdl" with anything else.
if k.downcase == "odbl" or k.downcase == "obdl"
if (k.downcase == "odbl" or
k.downcase == "obdl" or
k.downcase == "oodbl")
val = tags[k].downcase
# tag synonyms for "clean" in this context
(val == "clean" ||
val == "clear" ||
val == "true" ||
val == "yes" ||
val == "1")
Expand Down Expand Up @@ -286,9 +289,13 @@ def self.significant_tag?(old_v, new_v)
# now check for homophones (TODO: is this really appropriate?)
return false if Text::Metaphone.metaphone(old) == Text::Metaphone.metaphone(new)

# finally, look for changes in abbreviation.
# look for changes in abbreviation.
return false if Abbrev.equal_expansions(old, new)

# check if the strings are the same except for whitespace
# presence. this would be considered insignificant.
return false if old.gsub(/ /,"") == new.gsub(/ /,"")

# otherwise, just look at the strings...
old != new
end
Expand Down

0 comments on commit 14f7d76

Please sign in to comment.