code: private int extendedIndexOf(List<String> vec, String str, int init_pos) throws ContextPreprocessorException {
          try {
              // for all words in the input list starting from init_pos
              for (int i = init_pos; i < vec.size(); i++) {
                  String vel = vec.get(i);
                  // try syntactic
                  if (vel.equals(str)) {
                      return i;
                  } else if (vel.indexOf(str) == 0) {
                      // and semantic comparison
                      if (linguisticOracle.isEqual(vel, str)) {
                          vec.add(i, str);
                          vec.remove(i + 1);
                          return i;
                      }
                  }
              }
              return -1;
          } catch (LinguisticOracleException e) {
              final String errMessage = e.getClass().getSimpleName() + ": " + e.getMessage();
              log.error(errMessage, e);
              throw new ContextPreprocessorException(errMessage, e);
          }
      }
docs: An extension of the list indexOf method which uses approximate comparison of the words as
  elements of the List.
  
  @param vec      list of strings
  @param str      string to search
  @param init_pos start position
  @return position
  @throws ContextPreprocessorException ContextPreprocessorException