code: public static List<Integer> exactStringFinder(final String pattern,
        final String sentence) {
      final char[] patternArray = pattern.toCharArray(), sentenceArray = sentence
          .toCharArray();
      int i, j;
      final int patternLength = patternArray.length;
      final int sentenceLength = sentenceArray.length;
      final List<Integer> neChars = new ArrayList<Integer>();
      for (j = 0; j <= sentenceLength - patternLength; ++j) {
        for (i = 0; i < patternLength && patternArray[i] == sentenceArray[i + j]; ++i) {
          ;
        }
        if (i >= patternLength) {
          neChars.add(j);
          neChars.add(i + j);
        }
      }
      return neChars;
    }
docs: Finds a pattern (typically a named entity string) in a sentence string. It
  outputs the offsets for the start and end characters named entity found, if
  any.
  
  @param pattern
  the pattern to be searched
  @param sentence
  the sentence
  @return a list of integers corresponding to the characters of the string
  found