Class XCoord

All Implemented Interfaces:
Extractor

public class XCoord extends AbstractFlexPat
Use this XCoord class for both test and development of patterns, as well as to extract coordinates at runtime.
Author:
ubaldino
  • Field Details

    • RUNTIME_FLAGS

      public static long RUNTIME_FLAGS
      Reserved. This is a bit mask for caller to use. DEFAULTS: (a) enable all false-positive filters for coordinate types; (b) extract context around coordinate.
    • DEFAULT_XCOORD_CFG

      protected static final String DEFAULT_XCOORD_CFG
      See Also:
  • Constructor Details

    • XCoord

      public XCoord(boolean debugmode)
      Debugging constructor -- if debugmode = True, enable debugging else if log4j debug mode is enabled, respect that.
      Parameters:
      debugmode -
    • XCoord

      public XCoord()
      Default constructor, debugging off.
  • Method Details

    • getName

      public String getName()
      Extractor interface: getName
      Returns:
      name of extractor
    • createPatternManager

      protected RegexPatternManager createPatternManager(InputStream s, String n) throws IOException
      Description copied from class: AbstractFlexPat
      Create a pattern manager given the input stream and the file name.
      Specified by:
      createPatternManager in class AbstractFlexPat
      Parameters:
      s - stream of patterns config file
      n - app name
      Returns:
      the regex pattern manager
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • extract

      public List<TextMatch> extract(TextInput input)
      Support the standard Extractor interface. This provides access to the most common extraction;
      Parameters:
      input - text input
      Returns:
      the list of matches
    • extract

      public List<TextMatch> extract(String input_buf)
      Support the standard Extractor interface. This provides access to the most common extraction;
      Parameters:
      input_buf - text
      Returns:
      the list of matches
    • setStrictMode

      public static void setStrictMode(boolean b)
    • getStrictMode

      public static boolean getStrictMode()
    • enableAll

      public void enableAll()
      Overrides:
      enableAll in class AbstractFlexPat
    • disableAll

      public void disableAll()
      Overrides:
      disableAll in class AbstractFlexPat
    • match_DMS

      public void match_DMS(boolean flag)
      Enable matching of DMS patterns
      Parameters:
      flag - on/off
    • match_DM

      public void match_DM(boolean flag)
      Enable matching of DM patterns
      Parameters:
      flag - on/off
    • match_DD

      public void match_DD(boolean flag)
      Enable matching of DD patterns
      Parameters:
      flag - on/off
    • match_MGRS

      public void match_MGRS(boolean flag)
      Enable matching of MGRS patterns
      Parameters:
      flag - on/off
    • match_UTM

      public void match_UTM(boolean flag)
      Enable matching of UTM patterns
      Parameters:
      flag - on/off
    • extract_coordinates

      public TextMatchResult extract_coordinates(String text, String text_id)
      Assess all enabled patterns against the given text. Resulting TextMatch objects carry both the original text ID and their own match ID
      Parameters:
      text - text to match against
      text_id - identifier for text.
      Returns:
    • extract_coordinates

      public TextMatchResult extract_coordinates(String text, String text_id, int family)
      Limit the extraction to a particular family of coordinates. Diagnostic messages appear in TextMatchResultSet only when debug = ON.
      Parameters:
      text - text to match
      text_id - id for text
      family - pattern family or XConstants.ALL_PATTERNS
      Returns:
      TextMatchResultSet result set. If input is null, result set is null