private int printBeforeContext() {
        int ret = 0;
        String pre = "";
        
        String before = cleanWord(beforeWord.toString().toLowerCase());
                
        if(contextSegmentation == CHARACTER) {
            before = before.replaceAll(" ","#");
            
            for (int i = before.length() - 1; i >= 0 && ret < contextSize; --i) {
                pre = before.charAt(i) + " " + pre;
                ++ret;
            }
            
        } else {
            String[] befores = before.split(" ");

            for (int i = befores.length - 1; i > 0 && ret < contextSize; --i) {
                String cleaned = cleanWord(befores[i].toLowerCase());
                if (!cleaned.isEmpty()) {
                    pre = cleaned + " " + pre;
                    ++ret;
                }
            }
        }

        System.out.print(pre);
        return ret;
    }