Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-9371

Make RegExp internal state more visible to support more rendering formats

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      This is a proposal to open up read-only access to the internal state of RegExp objects.

      The RegExp parser provides a useful parsed object model for regular expressions. Today it offers three rendering functions:
      1) To Automaton (for query execution)
      2) To string (for machine-readable regular expressions)
      3) To StringTree (for debug purposes)

      There are at least 2 other rendering functions that would be useful:
      a) To "Explain" format (like the plain-English descriptions used in regex debugging tools)
      b) To Query (queries used to accelerate regex searches by providing an approximation of the search terms and hitting an ngram index)

      To support these and other renderings/transformations it would be useful to open read-only access to the fields held in RegExp objects - either through making them public finals or offering getter access methods. This would free the RegExp class from having to support all possible transformations.

       

        Attachments

          Activity

            People

            • Assignee:
              mharwood Mark Harwood
              Reporter:
              mharwood Mark Harwood
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: