/** * Compute the results of matching the phrase in the input. */ @Override public List<SearchResults.Result> compute() { // Compute sequentially if the input is too small to split // further. if (mInput.length() < mMinSplitSize) return computeSequentially(); else { // Compute a candidate position for splitting the input. int startPos, splitPos = mInput.length() / 2; // Get the position to start determining if a phrase spans // the split position. if ((startPos = computeStartPos(splitPos)) < 0) return null; // Update splitPos if a phrase spans across the initial // splitPos. if ((splitPos = tryToUpdateSplitPos(startPos, splitPos)) < 0) return null; // Create a new PhraseMatchTask that handles the "left // hand" portion of the input, while the "this" object // handles the "right hand" portion of the input. return splitInput(splitPos); } }