code: private boolean isGoodAnchor(String text, int index) {
          // Check if there is space and punctuation mark after block
          String punct = " .,:!?\t\n";
          if (index >= 0 && index < text.length()) {
              if (punct.indexOf(text.charAt(index)) == -1) {
                  return false;
              }
          }
  
          return true;
      }
docs: Test if symbol at index is space or out of string bounds
  
  @param text  text
  @param index char to test
  @return is good anchor