Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-3687

RegexAnnotator variable value cannot contain $ sign

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.1Addons
    • None
    • Sandbox-RegexAnnotator
    • None
    • Eclipse Kepler on Mac OS 10.9.2 running Java 7

    Description

      Regex Annotator cannot replace variables which value contain $.
      Caused by: java.lang.IllegalArgumentException: Illegal group reference
      at java.util.regex.Matcher.appendReplacement(Matcher.java:808)
      at java.util.regex.Matcher.replaceAll(Matcher.java:906)
      at java.lang.String.replaceAll(String.java:2162)
      at org.apache.uima.annotator.regex.impl.Rule_impl.replaceRegexVariables(Rule_impl.java:371)
      at org.apache.uima.annotator.regex.impl.Rule_impl.initialize(Rule_impl.java:285)

      Sample variable:
      <variable name="dollar" value="US\$|USD" />

      Caused by the code escaping backslashes without escaping dollar sign in ConceptFileParser_impl.java:103 and then later used directly as replacement value in Rule_impl.java:371, causing the dollar sign to be interpreted as start of group reference, hence the "Illegal group reference" error.

      Attachments

        Activity

          People

            Unassigned Unassigned
            justhalf Aldrian Obaja
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified