ProofreadingResult getCheckResults ( String paraText , Locale locale , ProofreadingResult paRes , int [ ] footnotePositions , boolean isParallelThread , JLanguageTool langTool ) { try { SingleProofreadingError [ ] sErrors = null ; paraNum = getParaPos ( paraText , isParallelThread ) ; // Don't use Cache for check in single paragraph mode if ( numParasToCheck != 0 && paraNum >= 0 && doResetCheck ) { sErrors = sentencesCache . getMatches ( paraNum , paRes . nStartOfSentencePosition ) ; // return Cache result if available if ( sErrors != null ) { paRes . nStartOfNextSentencePosition = sentencesCache . getNextSentencePosition ( paraNum , paRes . nStartOfSentencePosition ) ; paRes . nBehindEndOfSentencePosition = paRes . nStartOfNextSentencePosition ; } } if ( debugMode > 1 ) { MessageHandler . printToLogFile ( "... Check Sentence: numCurPara: " + paraNum + "; startPos: " + paRes . nStartOfSentencePosition + "; Paragraph: " + paraText + ", sErrors: " + ( sErrors == null ? 0 : sErrors . length ) + logLineBreak ) ; } if ( sErrors == null ) { SentenceFromPara sfp = new SentenceFromPara ( paraText , paRes . nStartOfSentencePosition , langTool ) ; String sentence = sfp . getSentence ( ) ; paRes . nStartOfSentencePosition = sfp . getPosition ( ) ; paRes . nStartOfNextSentencePosition = sfp . getPosition ( ) + sentence . length ( ) ; paRes . nBehindEndOfSentencePosition = paRes . nStartOfNextSentencePosition ; sErrors = checkSentence ( sentence , paRes . nStartOfSentencePosition , paRes . nStartOfNextSentencePosition , paraNum , footnotePositions , isParallelThread , langTool ) ; } SingleProofreadingError [ ] pErrors = checkParaRules ( paraText , paraNum , paRes . nStartOfSentencePosition , paRes . nStartOfNextSentencePosition , isParallelThread , langTool ) ; paRes . aErrors = mergeErrors ( sErrors , pErrors ) ; if ( debugMode > 1 ) { MessageHandler . printToLogFile ( "paRes.aErrors.length: " + paRes . aErrors . length + "; docID: " + docID + logLineBreak ) ; } textIsChanged = false ; } catch ( Throwable t ) { MessageHandler . showError ( t ) ; } return paRes ; }
get the result for a check of a single document