Load words, normalized to lowercase unless starting with '*'.
172036
private static Set<String> loadWords(String path) {
    Set<String> set = new HashSet<>();
    InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path);
    try (Scanner scanner = new Scanner(stream, "utf-8")) {
      while (scanner.hasNextLine()) {
        String line = scanner.nextLine().trim();
        if (line.isEmpty() || line.charAt(0) == '#') {
          continue;
        }
        if (line.charAt(0) == '*') {
          set.add(line.substring(1));
        } else {
          set.add(line.toLowerCase());
        }
      }
    }
    return Collections.unmodifiableSet(set);
  }
1232047
def normal_case(name):
    """"""
    s1 = re.sub(r'(.)([A-Z][a-z]+)', r'\1 \2', name)
    return re.sub(r'([a-z0-9])([A-Z])', r'\1 \2', s1).lower()
737503
def normalize(location_name, preserve_commas=False):
    """"""
    def replace(match):
        if preserve_commas and ',' in match.group(0):
            return ','
        return ' '
    return NORMALIZATION_RE.sub(replace, location_name).strip().lower()
1069536
def camelize(string, lowercase = false)
      result = string
        .to_s
        .split("_")
        .map { |e| e.capitalize }
        .join

      if lowercase
        result[0, 1].downcase + result[1..-1]
      else
        result
      end
    end
893148
function lowercase(arr) {
  var ret = new Array(arr.length);

  for (var i = 0; i < arr.length; ++i) {
    ret[i] = String(arr[i]).toLowerCase();
  }

  return ret;
}
944854
def raw(text):
    """"""
    new_string = ''
    for char in text:
        try:
            new_string += escape_dict[char]
        except KeyError:
            new_string += char
    return new_string
978118
def cleanString(someText):
    
    ret = ''
    if someText is not None:
        ret = filter(unicode.isalnum, someText.lower())
    return ret
988910
def lower_case(f):
    """"""
    # if it has already been wrapped, we return original
    if hasattr(f, "lower_cased"):
        return f

    @wraps(f)
    def wrapper(*args, **kwargs):
        f.lower_cased = True
        return f(*args, **kwargs).lower()

    return wrapper
151084
def lowercase_chars(string: any) -> str:
        """"""
        return ''.join([c if c.islower() else '' for c in str(string)])
1218591
def _normalize(self, word):
        '''
        '''
        if '-' in word and word[0] != '-':
            return '!HYPHEN'
        elif word.isdigit() and len(word) == 4:
            return '!YEAR'
        elif word[0].isdigit():
            return '!DIGITS'
        else:
            return word.lower()
1092431
def _keys_to_lower(self):
        """"""
        for k in list(self.keys()):
            val = super(CaseInsensitiveDict, self).__getitem__(k)
            super(CaseInsensitiveDict, self).__delitem__(k)
            self.__setitem__(CaseInsensitiveStr(k), val)
1070892
def normalize_string_keys(old):
    """"""
    new = {}
    for key, value in old.items():
        if isinstance(key, bytes_):
            new[key.decode('utf8')] = value
        else:
            new[key] = value
    return new
179634
def loadb(chars, no_bytes=False, object_hook=None, object_pairs_hook=None, intern_object_keys=False):
    """"""
    with BytesIO(chars) as fp:
        return load(fp, no_bytes=no_bytes, object_hook=object_hook, object_pairs_hook=object_pairs_hook,
                    intern_object_keys=intern_object_keys)
385672
def normalize(string: Text) -> Text:
    

    string = string.lower()
    string = unidecode(string)
    string = RE_WHITESPACES.sub(' ', string).strip()

    return string
1144821
def case_sensitive(self, lst):
        
        dictionary = {}
        for pkg in lst:
            dictionary[pkg.lower()] = pkg
        return dictionary
174305
def __normalize(self,text):
        
        return self._normalizer_regex.sub(lambda mo:
                self._normalizer[mo.string[mo.start():mo.end()]],
                    text.lower())
1206594
protected String normalize(CharSequence sequence) {
      if (isCaseSensitive()) {
         return sequence.toString();
      }
      return sequence.toString().toLowerCase();
   }