public String splitKeywords(String contents){
  if (contents == null) {
    return Values.EMPTYSTRING;
  }
  StringBuilder indexContents=new StringBuilder();
  contents=contents.replaceAll("[^a-zA-Z0-9]"," ");
  if (contents.length() > this.MAXSPLITLENGTH) {
    contents=contents.substring(0,MAXSPLITLENGTH) + "AAA";
  }
  for (  String splitContents : contents.split(" ")) {
    if (splitContents.length() >= 7) {
      Matcher m=MULTIPLEUPPERCASE.matcher(splitContents);
      if (!m.find()) {
        String[] splitStrings=splitContents.split("(?=\\p{Upper})");
        if (splitStrings.length > 1) {
          indexContents.append(" ");
          indexContents.append(StringUtils.join(splitStrings," "));
        }
      }
    }
  }
  return indexContents.toString();
}

public String splitKeywords ( String contents ) { if ( contents == null ) { return Values . EMPTYSTRING ; } StringBuilder indexContents = new StringBuilder ( ) ; contents = contents . replaceAll ( "[^a-zA-Z0-9]" , " " ) ; if ( contents . length ( ) > this . MAXSPLITLENGTH ) { contents = contents . substring ( 0 , MAXSPLITLENGTH ) + "AAA" ; } for ( String splitContents : contents . split ( " " ) ) { if ( splitContents . length ( ) >= 7 ) { Matcher m = MULTIPLEUPPERCASE . matcher ( splitContents ) ; if ( ! m . find ( ) ) { String [ ] splitStrings = splitContents . split ( "(?=\\p{Upper})" ) ; if ( splitStrings . length > 1 ) { indexContents . append ( " " ) ; indexContents . append ( StringUtils . join ( splitStrings , " " ) ) ; } } } } return indexContents . toString ( ) ; }
split " intelligently " on anything over 7 characters long if it only contains [ a - za - z ] split based on uppercase string [ ] r = s . split ( " ( ? = \ \ p { upper } ) " ) ; add those as additional words to index on so that things like regexindexer becomes regex indexer split the string by spaces look for anything over 7 characters long if its only [ a - za - z ] split by uppercase
