     
     private class func regexReplace(input: String, pattern: String, template: String) -> String {
         var regex = NSRegularExpression(pattern: pattern, options: .CaseInsensitive, error: nil)!
-        var range = NSMakeRange(0, countElements(input))
+        var range = NSMakeRange(0, count(input))
         var output = regex.stringByReplacingMatchesInString(input, options: nil, range: range, withTemplate: template)
         return output
     }

    }
    
    public class func apply(var word: String) -> String {
        if contains(sharedInstance.uncountables, word.lowercaseString) || countElements(word) == 0 {
            return word
        } else {
            for pair in sharedInstance.rules {

        if count == 1 {
            return self
        } else {
            if with.length != 0 {
                return with
            } else {
                return Pluralize.apply(self)
            }
        }
    }

    // Workaround to allow us to use `count` as an argument name in pluralize() above.
    private var length: Int {
        return count(self)
    }
}
