public static TagAndStyle buildParagraphTagAndStyle(String styleName, boolean isTable) {

        if (styleName == null || styleName.length() < 2) {
            return defaultParagraphStyle;
        }

        TagAndStyle tagAndStyle = fixedParagraphStyles.get(styleName);
        if (tagAndStyle != null) {
            return tagAndStyle;
        }

        if (styleName.equals("Table Contents") && isTable) {
            return defaultParagraphStyle;
        }

        String tag = "p";
        String styleClass = null;

        if (styleName.startsWith("heading") || styleName.startsWith("Heading")) {
            // "Heading 3" or "Heading2" or "heading 4"
            int num = 1;
            try {
                num = Integer.parseInt(styleName.substring(styleName.length() - 1));
            } catch (NumberFormatException e) {
                //swallow
            }
            // Turn it into a H1 - H6 (H7+ isn't valid!)
            tag = "h" + Math.min(num, 6);
        } else {
            styleClass = styleName.replace(' ', '_');
            styleClass =
                    styleClass.substring(0, 1).toLowerCase(Locale.ROOT) + styleClass.substring(1);
        }

        return new TagAndStyle(tag, styleClass);
    }
Given a style name, return what tag should be used, and
what style should be applied to it.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/WordExtractor.java