Checks if the token is a sentence start.
@return True if the element starts the sentence and the element hasn't been set to have negated POS token.
480724
public boolean isSentenceStart() {
    return posToken != null && JLanguageTool.SENTENCE_START_TAGNAME.equals(posToken.posTag) && !posToken.negation;
  }
1127825
public boolean hasNext() {
        if (currentIndex == endIndex) {
            return false;
        }
              
        // Otherwise, see if nextElement is null. If so, try to load the next
        // element to make sure it exists.
        if (nextElement == null) {
            nextElement = getNextElement();
            if (nextElement == null) {
                return false;
            }
        }
        return true;
    }
332509
def isin_start(elems, line):
    
    found = False
    elems = [elems] if type(elems) is not list else elems
    for e in elems:
        if line.lstrip().lower().startswith(e):
            found = True
            break
    return found
610287
protected boolean doStart()
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    
    if (! isEnable()) {
      return false;
    }
    
    int startingCount = _startingCount.getAndIncrement();

    int threadCount = _threadCount.get() + startingCount;

    if (_threadMax < threadCount) {
      _startingCount.decrementAndGet();
      
      onThreadMax();
      
      return false;
    }
    else if (isIdleTooLow(startingCount)) {
      return true;
    }
    else {
      _startingCount.decrementAndGet();
      
      return false;
    }
  }
182007
public boolean isStartedBy(T element) {
    if (element == null) { return false; }
    return comparator.compare(element, min) == 0;
  }
343520
def paragraph_starts(self):
        """"""
        if not self.is_tagged(PARAGRAPHS):
            self.tokenize_paragraphs()
        return self.starts(PARAGRAPHS)
605914
private boolean areLemmasSame() {
    String previousLemma = anTokReadings[0].getLemma();
    if (previousLemma == null) {
      for (AnalyzedToken element : anTokReadings) {
        if (element.getLemma() != null) {
          return false;
        }
      }
      return true;
    }
    for (AnalyzedToken element : anTokReadings) {
      if (!previousLemma.equals(element.getLemma())) {
        return false;
      }
    }
    return true;
  }
352219
public function isNextOpenerOrWord() : bool
    {
        $token = current($this->tokens);

        if ($token === false) {
            throw new GeometryIOException("Expected '(' or word but encountered end of stream");
        }

        if ($token[1] === '(') {
            return true;
        }

        if ($token[0] === static::T_WORD) {
            return false;
        }

        throw new GeometryIOException("Expected '(' or word but encountered '" . $token[1] . "'");
    }
295098
private boolean containsOnlyInfinitivesToTheLeft(AnalyzedTokenReadings[] tokens, int startPos) throws IOException {
    int infinitives = 0;
    for (int i = startPos; i > 0; i--) {
      String token = tokens[i].getToken();
      if (tokens[i].hasPartialPosTag("SUB:")) {
        AnalyzedTokenReadings lookup = tagger.lookup(token.toLowerCase());
        if (lookup != null && lookup.hasPosTagStartingWith("VER:INF")) {
          infinitives++;
        } else {
          return false;
        }
      }
    }
    return infinitives >= 2;
  }
635771
private boolean doStart()
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    
    if (! isEnable()) {
      return false;
    }
    
    int startingCount = _startingCount.get();

    int threadCount = _threadCount.get() + startingCount;

    if (_threadMax < threadCount) {
      onThreadMax();
      
      return false;
    }
    else if (! isIdleTooLow(startingCount)) {
      return false;
    }
    
    _idleCount.incrementAndGet();

    startConnection();
      
    return true;
  }
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;
    }
195212
private boolean nextFromProlog(boolean isProlog)
        throws XMLStreamException
    {
        int i;

        // First, do we need to finish currently open token?
        if (mTokenState < mStTextThreshold) {
            mTokenState = TOKEN_FULL_COALESCED;
            i = skipToken();
            // note: skipToken() updates the start location
        } else {
            // Need to update the start location...
            mTokenInputTotal = mCurrInputProcessed + mInputPtr;
            mTokenInputRow = mCurrInputRow;
            mTokenInputCol = mInputPtr - mCurrInputRowStart;
            i = getNext();
        }

        // Any white space to parse or skip?
        if (i <= CHAR_SPACE && i >= 0) {
            // Need to return as an event?
            if (hasConfigFlags(CFG_REPORT_PROLOG_WS)) {
                mCurrToken = SPACE;
                if (readSpacePrimary((char) i, true)) {
                    /* no need to worry about coalescing, since CDATA is not
                     * allowed at this level...
                     */
                    mTokenState = TOKEN_FULL_COALESCED;
                } else {
                    if (mCfgLazyParsing) {
                        /* Let's not even bother checking if it's
                         * "long enough"; shouldn't usually matter, but few
                         * apps care to get multiple adjacent SPACE events...
                         */
                        mTokenState = TOKEN_STARTED;
                    } else {
                        readSpaceSecondary(true);
                        mTokenState = TOKEN_FULL_COALESCED;
                    }
                }
                return false;
            }
            // If not, can skip it right away
            --mInputPtr; // to handle linefeeds gracefully
            i = getNextAfterWS();
            if (i >= 0) {
                // ... after which location has to be reset properly:
                /* 11-Apr-2005, TSa: But note that we need to "move back"
                 *   column and total offset values by one, to compensate
                 *   for the char that was read (row can not have changed,
                 *   since it's non-WS, and thus non-lf/cr char)
                 */
                mTokenInputTotal = mCurrInputProcessed + mInputPtr - 1;
                mTokenInputRow = mCurrInputRow;
                mTokenInputCol = mInputPtr - mCurrInputRowStart - 1;
            }
        }

        // Did we hit EOI?
        if (i < 0) {
            handleEOF(isProlog);
            mParseState = STATE_CLOSED;
            return true;
        }

        // Now we better have a lt...
        if (i != '<') {
            throwUnexpectedChar(i, (isProlog ? SUFFIX_IN_PROLOG : SUFFIX_IN_EPILOG)
                                +"; expected '<'");
        }

        // And then it should be easy to figure out type:
        char c = getNextChar(isProlog ? SUFFIX_IN_PROLOG : SUFFIX_IN_EPILOG);

        if (c == '?') { // proc. inst
            mCurrToken = readPIPrimary();
        } else  if (c == '!') { // DOCTYPE or comment (or CDATA, but not legal here)
            // Need to figure out bit more first...
            nextFromPrologBang(isProlog);
        } else if (c == '/') { // end tag not allowed...
            if (isProlog) {
                throwParseError("Unexpected character combination '</' in prolog.");
            }
            throwParseError("Unexpected character combination '</' in epilog (extra close tag?).");
        } else if (c == ':' || isNameStartChar(c)) {
            // Root element, only allowed after prolog
            if (!isProlog) {
                /* This call will throw an exception if there's a problem;
                 * otherwise set up everything properly
                 */
                mCurrToken = handleExtraRoot(c); // will check input parsing mode...
                return false;
            }
            handleRootElem(c);
            mCurrToken = START_ELEMENT;
        } else {
            throwUnexpectedChar(c, (isProlog ? SUFFIX_IN_PROLOG : SUFFIX_IN_EPILOG)
                                +", after '<'.");
        }

        // Ok; final twist, maybe we do NOT want lazy parsing?
        if (!mCfgLazyParsing && mTokenState < mStTextThreshold) {
            finishToken(false);
        }

        return false;
    }
592609
public boolean startsWith(CharSequence text)
    {
        try
        {
            if (text.length() == 0)
            {
                if (acceptEmpty)
                {
                    return true;
                }
                else
                {
                    throw new SyntaxErrorException("empty string not accepted");
                }
            }
            InputReader reader = Input.getInstance(text);
            return startsWith(reader);
        }
        catch (IOException ex)
        {
            throw new IllegalArgumentException("can't happen");
        }
    }
535663
private boolean goToNextStartPosition() throws IOException {
    int nextSpans1StartPosition;
    while ((nextSpans1StartPosition = spans1.spans
        .nextStartPosition()) != NO_MORE_POSITIONS) {
      if (nextSpans1StartPosition == lastSpans2EndPosition) {
        return true;
      } else {
        // clean up
        if (maximumSpans2EndPosition < nextSpans1StartPosition) {
          previousSpans2EndPositions.clear();
          maximumSpans2EndPosition = -1;
        } else if (previousSpans2EndPositions
            .contains(nextSpans1StartPosition)) {
          return true;
        }
        // try to find match
        while (lastSpans2StartPosition < nextSpans1StartPosition) {
          if (lastSpans2StartPosition != NO_MORE_POSITIONS) {
            lastSpans2StartPosition = spans2.spans.nextStartPosition();
          }
          if (lastSpans2StartPosition == NO_MORE_POSITIONS) {
            if (previousSpans2EndPositions.isEmpty()) {
              noMorePositions = true;
              return false;
            }
          } else {
            lastSpans2EndPosition = spans2.spans.endPosition();
            if (lastSpans2EndPosition >= nextSpans1StartPosition) {
              previousSpans2EndPositions.add(lastSpans2EndPosition);
              maximumSpans2EndPosition = Math.max(maximumSpans2EndPosition,
                  lastSpans2EndPosition);
            }
            if (nextSpans1StartPosition == lastSpans2EndPosition) {
              return true;
            }
          }
        }
      }
    }
    return false;
  }
484110
public boolean isCurrentIgnoreSpace(String str) {
	if (!hasNext()) return false;
	int start = getPos();
	removeSpace();

	boolean is = isCurrent(str);
	setPos(start);
	return is;
    }
673397
private static boolean hasBreakToken(AnalyzedTokenReadings[] tokens) {
    for (int i = 0; i < tokens.length && i < MAX_TOKEN_TO_CHECK; i++) {
      if (tokens[i].getToken().equals("-") || tokens[i].getToken().equals("—") || tokens[i].getToken().equals("–")) {
        return true;
      }
    }
    return false;
  }
288007
public boolean hasNext()
    {
        if ( _matcher == null )
        {
            return false;
        }
        if ( _literal != null || _token != null )
        {
            return true;
        }
        if ( _matcher.find() )
        {
            _literal = _template.subSequence( _endPrevios, _matcher.start() ).toString();
            _token = _matcher.group();
            _endPrevios = _matcher.end();
        }
        else if ( _endPrevios < _template.length() )
        {
            // We're at the end
            _literal = _template.subSequence( _endPrevios, _template.length() ).toString();
            _endPrevios = _template.length();

            // Remove the matcher so it doesn't reset itself
            _matcher = null;
        }
        return _literal != null || _token != null;
    }