If pos is ending a word in str: returns this word.
Else: returns null;
169979
protected static String getEndedWord(String str, int pos){
		assert(pos < str.length() && pos >= 0);

		if(	posIsAtWordEnd(str, pos) ){
			int prevSpace = findLastNonLetterOrDigit(str, pos);

			return str.substring(prevSpace+1, pos+1);
		}
		return null;
	}
325353
def _getLPA( self ):
        "  "
        return str( self.line ) + ":" + \
               str( self.pos ) + ":" + \
               str( self.absPosition )
103691
function between($str, $start, $end = null, $greed = true)
    {
        if (isset($start)) {
            $pos1 = strpos($str, $start);
        } else {
            $pos1 = 0;
        }
        if (isset($end)) {
            if ($greed) {
                $pos2 = strrpos($str, $end);
            } else {
                $pos2 = strpos($str, $end, $pos1);
            }
        } else {
            $pos2 = strlen($str);
        }
        if (false === $pos1 || false === $pos2 || $pos2 < $pos1) {
            return '';
        }
        $len = strlen($start);
        return substr($str, $pos1 + $len, $pos2 - $pos1 - $len);
    }
42034
function getSubStr(str, pos, len) {
  if (pos < 0 || pos + len > str.length) {
    return "";
  }
  return str.substr(pos, len);
}
155407
function right(str, pos) {
            if (typeof str === "undefined" || typeof pos === "undefined") return "";
            str = '' + str;
            if (isString(pos)) {
                return str.lastIndexOf(pos) > -1 ? str.substr(str.lastIndexOf(pos) + 1) : "";
            } else if (isNumber(pos)) {
                return str.substr(str.length - pos);
            } else {
                return "";
            }
        }
758609
def eol_distance_last(self, offset=0):
        """"""
        distance = 0
        for char in reversed(self.string[:self.pos + offset]):
            if char == '\n':
                break
            else:
                distance += 1
        return distance
1309951
private static boolean detectNameWordInSentenceByPosition(final List<Token> _text, final int _pos) {
        boolean isFirstWord = false;
        boolean nextWordIsName = false;
        if (_pos == 0 || !isLetterOrDigit((_text.get(_pos - 1).text.charAt(0)))) {
            isFirstWord = true;
            //noinspection SimplifiableIfStatement
            if (_text.size() > _pos + 1) {
                final String plus1 = _text.get(_pos + 1).text;
                nextWordIsName = ("of".equalsIgnoreCase(plus1) || "'s".equalsIgnoreCase(plus1))
                                 ? ((_text.size() > (_pos + 2)) && isName(_text.get(_pos + 2).text, false, false))
                                 : isName(plus1, false, false);
            }
            else nextWordIsName = false;
        }
        //noinspection UnnecessaryLocalVariable
        final boolean isName = isName(_text.get(_pos).text, isFirstWord, nextWordIsName);

        /*
        String wordType = dict.checkup(Strings.toEngLowerCase(_text.get(_pos));
        if (isFirstWord && !isName && wordType != null && wordType.startsWith("JJ")) {
            // if the first word is determined not to be a name but it is an adj.,
            // and if the second word is a name, we consider the first word to be a name as well.
            if (isName(_text.get(_pos + 1), false))
                return true;
        }
        */

        return isName;
    }
261920
protected static String getPartialStartedWord(String str, int pos){
		assert(pos < str.length() && pos >= 0);

		if(	posIsAtWord(str, pos) ){
			int nextSpace = findNextNonLetterOrDigit(str, pos);
			if(nextSpace == -1){
				nextSpace = str.length();
			}
			
			return str.substring(pos, nextSpace);
		}
		return null;
	}
1098885
protected static String getStartedWord(String str, int pos){
		assert(pos < str.length() && pos >= 0);

		if(	posIsAtWordStart(str, pos) ){
			int nextSpace = findNextNonLetterOrDigit(str, pos);
			if(nextSpace == -1){
				nextSpace = str.length();
			}
			
			return str.substring(pos, nextSpace);
		}
		return null;
	}
1286951
def _ends_with(self, string_to_edit, end):  # pylint: disable=no-self-use
        
        if not string_to_edit.endswith(end):
            return string_to_edit + end
        return string_to_edit
8918
def finished(tokens, s):
    
    if s.pos >= len(tokens):
        return None, s
    else:
        raise NoParseError(u'should have reached <EOF>', s)
1257924
function findWord(cm, lineNum, pos, dir, regexps) {
    var line = cm.getLine(lineNum);
    while (true) {
      var stop = (dir > 0) ? line.length : -1;
      var wordStart = stop, wordEnd = stop;
      // Find bounds of next word.
      for (; pos != stop; pos += dir) {
        for (var i = 0; i < regexps.length; ++i) {
          if (regexps[i].test(line.charAt(pos))) {
            wordStart = pos;
            // Advance to end of word.
            for (; pos != stop && regexps[i].test(line.charAt(pos)); pos += dir) {}
            wordEnd = (dir > 0) ? pos : pos + 1;
            return {
                from: Math.min(wordStart, wordEnd),
                to: Math.max(wordStart, wordEnd),
                line: lineNum};
          }
        }
      }
      // Advance to next/prev line.
      lineNum += dir;
      if (!isLine(cm, lineNum)) return null;
      line = cm.getLine(lineNum);
      pos = (dir > 0) ? 0 : line.length;
    }
  }
726617
def guess_line_ending(string):
    ''''''
    assert isinstance(string, str), 'Expect str. Got {}'.format(type(string))
    crlf_count = string.count('\r\n')
    lf_count = string.count('\n')

    if crlf_count >= lf_count:
        return '\r\n'
    else:
        return '\n'
697985
def find_next_word_ending(self, include_current_position=False, count=1, WORD=False):
        
        if count < 0:
            return self.find_previous_word_ending(count=-count, WORD=WORD)

        if include_current_position:
            text = self.text_after_cursor
        else:
            text = self.text_after_cursor[1:]

        regex = _FIND_BIG_WORD_RE if WORD else _FIND_WORD_RE
        iterable = regex.finditer(text)

        try:
            for i, match in enumerate(iterable):
                if i + 1 == count:
                    value = match.end(1)

                    if include_current_position:
                        return value
                    else:
                        return value + 1

        except StopIteration:
            pass
784841
def _afterpoint(string):
    
    if _isnumber(string):
        if _isint(string):
            return -1
        else:
            pos = string.rfind(".")
            pos = string.lower().rfind("e") if pos < 0 else pos
            if pos >= 0:
                return len(string) - pos - 1
            else:
                return -1  # no point
    else:
        return -1
356303
def p_end(p):
    
    q = make_number(0, lineno=p.lineno(1)) if len(p) == 2 else p[2]
    p[0] = make_sentence('END', q)
860625
@Nullable
  private String getWordAfterEnumerationOrNull(List<String> words, int idx) {
    for (int i = idx; i < words.size(); i++) {
      String word = words.get(i);
      if (!(word.endsWith("-") || StringUtils.equalsAny(word, ",", "und", "oder", "sowie") || word.trim().isEmpty())) {
        return word;
      }
    }
    return null;
  }