public String readWord() throws IOException {

        int charInt = -1;
        char c;
        StringBuilder sb = new StringBuilder();
        boolean stop = false;
        while((charInt = reader.read()) != -1) {
            c = (char) charInt;
            switch (c) {
                case '\n':
                    sb.append("</s>");
                    stop = true;
                    break;
                case '\t':
                case ' ':
                    if (sb.length() > 0) stop = true;
                    break;
                default:
                    sb.append(c);
                    break;
            }
            if (stop) break;
        }

        if (sb.length() == 0) {
            return null;
        }
        else {
            return sb.toString();
        }
    }