org.apache.nutch.parse.headings

## Class HeadingsParseFilter

- java.lang.Object
- - org.apache.nutch.parse.headings.HeadingsParseFilter

- All Implemented Interfaces:
    Configurable, HtmlParseFilter, Pluggable

      public class HeadingsParseFilter
      extends java.lang.Object
      implements HtmlParseFilter

  HtmlParseFilter to retrieve h1 and h2 values from the DOM.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.util.regex.Pattern` | `whitespacePattern` Pattern used to strip surpluss whitespace

    - ### Fields inherited from interface org.apache.nutch.parse.HtmlParseFilter

      `X_POINT_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HeadingsParseFilter()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ParseResult` | `filter(Content content, ParseResult parseResult, HTMLMetaTags metaTags, org.w3c.dom.DocumentFragment doc)` Adds metadata or otherwise modifies a parse of HTML content, given the DOM tree of a page.
    `Configuration` | `getConf()`
    `protected java.util.List<java.lang.String>` | `getElement(org.w3c.dom.DocumentFragment doc, java.lang.String element)` Finds the specified element and returns its value
    `protected static java.lang.String` | `getNodeValue(org.w3c.dom.Node node)` Returns the text value of the specified Node and child nodes
    `void` | `setConf(Configuration conf)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### whitespacePattern

          protected static java.util.regex.Pattern whitespacePattern

      Pattern used to strip surpluss whitespace

  - ### Constructor Detail

    - #### HeadingsParseFilter

          public HeadingsParseFilter()

  - ### Method Detail

    - #### filter

          public ParseResult filter(Content content,
                                    ParseResult parseResult,
                                    HTMLMetaTags metaTags,
                                    org.w3c.dom.DocumentFragment doc)

      Description copied from interface: `HtmlParseFilter`
      Adds metadata or otherwise modifies a parse of HTML content, given the DOM tree of a page.
      Specified by:
        `filter` in interface `HtmlParseFilter`

    - #### setConf

          public void setConf(Configuration conf)

      Specified by:
        `setConf` in interface `Configurable`

    - #### getConf

          public Configuration getConf()

      Specified by:
        `getConf` in interface `Configurable`

    - #### getElement

          protected java.util.List<java.lang.String> getElement(org.w3c.dom.DocumentFragment doc,
                                                                java.lang.String element)

      Finds the specified element and returns its value

    - #### getNodeValue

          protected static java.lang.String getNodeValue(org.w3c.dom.Node node)

      Returns the text value of the specified Node and child nodes

Copyright © 2019 The Apache Software Foundation