public void run(){
        // If there is not word to recognized or the word is empty then do not recognize
        if(word == null || word.trim().isEmpty()){
            return;
        }

        DefaultHighlighter.DefaultHighlightPainter highLighter = FileUtils.getInstance().getHighlighter();

        word = word.trim().toLowerCase();
        int documentLength = (endPosition == 0 ? textPane.getDocument().getLength() : endPosition);

        // Iterate through the document text
        try {
            for (int index = startPosition; index + word.length() <= documentLength; index++) {
                String match = textPane.getDocument().getText(index, word.length()).toLowerCase();
                // If there's a match then highlight the word
                if (word.equals(match)) {
                    position = index + word.length();
                    textPane.getHighlighter().addHighlight(index, position, highLighter);

                    // True - to highlight only the first match of the word
                    // False - to highlight all matches
                    if(highlightFirstMatchOnly) break;
                }
            }
        } catch (Exception e){
            e.printStackTrace();
        }
    }