org.apache.nutch.parse

## Class OutlinkExtractor

- java.lang.Object
- - org.apache.nutch.parse.OutlinkExtractor

-     public class OutlinkExtractor
      extends java.lang.Object

  Extractor to extract `Outlink`s / URLs from plain text using Regular Expressions.
  Since:
    0.7
  Version:
    1.0
  Author:
    Stephan Strittmatter - http://www.sybit.de
  See Also:
    Comparison of different regexp-Implementations , Overview about Java Regexp APIs

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OutlinkExtractor()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Outlink[]` | `getOutlinks(java.lang.String plainText, Configuration conf)` Extracts `Outlink` from given plain text.
    `static Outlink[]` | `getOutlinks(java.lang.String plainText, java.lang.String anchor, Configuration conf)` Extracts `Outlink` from given plain text and adds anchor to the extracted `Outlink`s

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

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

- - ### Constructor Detail

    - #### OutlinkExtractor

          public OutlinkExtractor()

  - ### Method Detail

    - #### getOutlinks

          public static Outlink[] getOutlinks(java.lang.String plainText,
                                              Configuration conf)

      Extracts `Outlink` from given plain text. Applying this method to non-plain-text can result in extremely lengthy runtimes for parasitic cases (postscript is a known example).
      Parameters:
        `plainText` - the plain text from wich URLs should be extracted.
      Returns:
        Array of `Outlink`s within found in plainText

    - #### getOutlinks

          public static Outlink[] getOutlinks(java.lang.String plainText,
                                              java.lang.String anchor,
                                              Configuration conf)

      Extracts `Outlink` from given plain text and adds anchor to the extracted `Outlink`s
      Parameters:
        `plainText` - the plain text from wich URLs should be extracted.
        `anchor` - the anchor of the url
      Returns:
        Array of `Outlink`s within found in plainText

Copyright © 2019 The Apache Software Foundation