You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ctakes.apache.org by "Sean Mullane (JIRA)" <ji...@apache.org> on 2017/05/24 15:35:04 UTC

[jira] [Comment Edited] (CTAKES-446) Piper file parameter value ignored when it contains quoted equals

    [ 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:34 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}
   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.


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

I believe changing PiperFileReader.java:89-90 from 
   static private final Pattern NAME_VALUE_PATTERN = Pattern
         .compile( "[^\"\\s=]+=(?:(?:[^\"=\\s]+)|(?:\"[^\"=\\r\\n]+\"))" );
to 
   static private final Pattern NAME_VALUE_PATTERN = Pattern
         .compile( "[^\"\\s=]+=(?:(?:[^\"=\\s]+)|(?:\"[^\"\\r\\n]+\"))" );
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)