ctakes-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Mullane (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CTAKES-446) Piper file parameter value ignored when it contains quoted equals
Date Wed, 24 May 2017 15:36:04 GMT

    [ https://issues.apache.org/jira/browse/CTAKES-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16023101#comment-16023101
] 

Sean Mullane edited comment on CTAKES-446 at 5/24/17 3:35 PM:
--------------------------------------------------------------

I was able to work around this on our SQL Server 2012 database by using 
bq. queryGetDocument="select Note_text from Note_Txt txt where NOTE_ID in (:instance_id)"


I believe changing PiperFileReader.java:89-90 from 
{quote}
{noformat}
   static private final Pattern NAME_VALUE_PATTERN = Pattern
         .compile( "[^\"\\s=]+=(?:(?:[^\"=\\s]+)|(?:\"[^\"=\\r\\n]+\"))" );
{noformat}
{quote}
to 
{quote}
{noformat}
   static private final Pattern NAME_VALUE_PATTERN = Pattern
         .compile( "[^\"\\s=]+=(?:(?:[^\"=\\s]+)|(?:\"[^\"\\r\\n]+\"))" );
{noformat}
{quote}
solves the problem. A bit of testing didn't surface any further problems with this.


was (Author: smullane):
I was able to work around this on our SQL Server 2012 database by using 
bq. queryGetDocument="select Note_text from Note_Txt txt where NOTE_ID in (:instance_id)"


I believe changing PiperFileReader.java:89-90 from 
{quote}
   static private final Pattern NAME_VALUE_PATTERN = Pattern
         .compile( "[^\"\\s=]+=(?:(?:[^\"=\\s]+)|(?:\"[^\"=\\r\\n]+\"))" );
{quote}
to 
{quote}
   static private final Pattern NAME_VALUE_PATTERN = Pattern
         .compile( "[^\"\\s=]+=(?:(?:[^\"=\\s]+)|(?:\"[^\"\\r\\n]+\"))" );
{quote}
solves the problem. A bit of testing didn't surface any further problems with this.

> Piper file parameter value ignored when it contains quoted equals
> -----------------------------------------------------------------
>
>                 Key: CTAKES-446
>                 URL: https://issues.apache.org/jira/browse/CTAKES-446
>             Project: cTAKES
>          Issue Type: Bug
>          Components: ctakes-core
>    Affects Versions: 4.0.0
>         Environment: Java 1.8
>            Reporter: Sean Mullane
>            Priority: Minor
>              Labels: easyfix, piper
>
> In piper file definition, parameters with a quoted "equals" sign in the parameter value
are not picked up by the piper file reader.
> This occurs because the NAME_VALUE_PATTERN regular expression ignores parameter values
containing "equals" signs. This pattern is valid in some cases, such as definition of a DBCollectionReader
reader.
> Example:
> //  Database Reader
> //  Read documents from a database.
> reader org.apache.ctakes.ytex.uima.DBCollectionReader queryGetDocumentKeys="select txt.NOTE_ID
instance_id from Note_Txt txt" queryGetDocument="select Note_text from Note_Txt txt where
NOTE_ID = :instance_id"



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message