You are viewing limited content. For full access, please sign in.

Question

Question

Testing area for pattern matching does not return the same result as when running the session directly

asked on February 11, 2014 Show version history

When I use the testing area in the pattern matching activity, the test does not return the same results as when I run the session directly given the same text input.

 

For example, I can run a session and copy the OCR-ed text from the output pane. I paste the text into the testing area in pattern matching and see that it returns a match. But when I run the session, the pattern matching activity returns a blank token, indicating that no match it found in the pattern. I verified that the OCR-ed text is consistent.

 

Has anybody encountered the same issue? What I am doing wrong in my testing procedures?

0 0

Replies

replied on February 12, 2014

In the process of copying the information you may be selecting a space and that may not match your pattern and hence the blank token.

0 0
replied on February 12, 2014

What version of Quick Fields are you using? Can you post your pattern and some sample input text?

0 0
replied on February 17, 2014

I am using Quick Fields 9.0.

 

Here is the text that I copied from output pane from a zone OCR activity (with slight modifications for privacy reasons):

 

Top Half : Ll
k
....... 71%
TUESDAY, JANUARY 14, 2014, 6:00 P.M.
Regular City Council Meeting
Regular X Public Financing Authority Meeting
Special City of X as Successor Agency to the
X Redevelopment Agency Meeting
Special City of X as Successor Housing Agency to the
X Redevelopment Agency Meeting
Special Fire Protection District Meeting
City Council Chambers
1 Y Drive
X, CA 90000
Cell Phones: As a courtesy to others, please silence your cell phone or pager during the meeting and engage in
conversations outside the Council Chambers.
Americans with Disabilities Act: If you need special assistance to participate in this meeting, please contact the
City Clerk at (123) 111-1111, ext. 1111. Notification 48 hours in advance will enable the City to make reasonable

 

The desired output for pattern matching is a multi-value token with five values:

Regular City Council Meeting
Regular X Public Financing Authority Meeting
Special City of X as Successor Agency to the X Redevelopment Agency Meeting
Special City of X as Successor Housing Agency to the X Redevelopment Agency Meeting
Special Fire Protection District Meeting

 

If I use the pattern Regular.*Meeting, I would get in the test area in the pattern matching activity:

"Regular City Council Meeting
Regular X Public Financing Authority Meeting"

 

When I run the actual session, the output would be the whole string:

"Regular City Council Meeting
Regular X Public Financing Authority Meeting
Special City of X as Successor Agency to the
X Redevelopment Agency Meeting
Special City of X as Successor Housing Agency to the
X Redevelopment Agency Meeting
Special Fire Protection District Meeting"

 

I understand that pattern matching is greedy, and the output from the actual session is the longest match for the pattern. I'm simply confused by how the test area handles a pattern with multiple matches, and why it displays different results from the actual session. (I figured out a pattern that works, so that's not my question.)

 

Another thing I ran into with this pattern matching exercise is how to deal with matches that include new line characters. When I use the match as a token to populate a field, the new lines do not display, so I end up with:

"Regular City Council MeetingRegular San Marcos Public Financing Authority MeetingSpecial City of San Marcos as Successor Agency to theSan Marcos Redevelopment Agency MeetingSpecial City of San Marcos as Successor Housing Agency to theSan Marcos Redevelopment Agency MeetingSpecial Fire Protection District Meeting"

 

I ended up using the substitution activity to replace any new line characters with spaces, but the substitution activity would aggregate all the values in a multi-value token into a single value separated by "; ". I then used an Assign Token Value activity to split the values back into a multi-value token, and I used to the trim function to get rid of the extra space that the substitution activity added.

 

Is there a simpler way to deal with new lines? I've had multiple clients that have patterns across multiple lines, and I have not been able to deal with them effectively. The way I do it currently seems very roundabout.

 

0 0
replied on March 7, 2016

I'm in the same boat with you. I will post my question which is pretty much your question. 

0 0
replied on February 22, 2018

I'm having the same problems. I will be following this.

0 0
replied on February 23, 2018

This is a known issue in Quick Fields 9 (bug reference ID 128923). The result you get when you're running the session is the correct one for "Regular.*Meeting". The issue has been fixed for version 10.

0 0
replied on October 16, 2019

I have same issue with WF pattern matching

0 0
replied on February 12, 2014 Show version history

I am using Quick Fields 9.0.

 

Here is the text that I copied from output pane from a zone OCR activity (with slight modifications for privacy reasons):

 

Top Half : Ll
k
....... 71%
TUESDAY, JANUARY 14, 2014, 6:00 P.M.
Regular City Council Meeting
Regular X Public Financing Authority Meeting
Special City of X as Successor Agency to the
X Redevelopment Agency Meeting
Special City of X as Successor Housing Agency to the
X Redevelopment Agency Meeting
Special Fire Protection District Meeting
City Council Chambers
1 Y Drive
X, CA 90000
Cell Phones: As a courtesy to others, please silence your cell phone or pager during the meeting and engage in
conversations outside the Council Chambers.
Americans with Disabilities Act: If you need special assistance to participate in this meeting, please contact the
City Clerk at (123) 111-1111, ext. 1111. Notification 48 hours in advance will enable the City to make reasonable

 

The desired output for pattern matching is a multi-value token with five values:

Regular City Council Meeting
Regular X Public Financing Authority Meeting
Special City of X as Successor Agency to the X Redevelopment Agency Meeting
Special City of X as Successor Housing Agency to the X Redevelopment Agency Meeting
Special Fire Protection District Meeting

 

If I use the pattern Regular.*Meeting, I would get in the test area in the pattern matching activity:

"Regular City Council Meeting
Regular X Public Financing Authority Meeting"

 

When I run the actual session, the output would be the whole string:

"Regular City Council Meeting
Regular X Public Financing Authority Meeting
Special City of X as Successor Agency to the
X Redevelopment Agency Meeting
Special City of X as Successor Housing Agency to the
X Redevelopment Agency Meeting
Special Fire Protection District Meeting"

 

I understand that pattern matching is greedy, and the output from the actual session is the longest match for the pattern. I'm simply confused by how the test area handles a pattern with multiple matches, and why it displays different results from the actual session. (I figured out a pattern that works, so that's not my question.)

 

Another thing I ran into with this pattern matching exercise is how to deal with matches that include new line characters. When I use the match as a token to populate a field, the new lines do not display, so I end up with:

"Regular City Council MeetingRegular San Marcos Public Financing Authority MeetingSpecial City of San Marcos as Successor Agency to theSan Marcos Redevelopment Agency MeetingSpecial City of San Marcos as Successor Housing Agency to theSan Marcos Redevelopment Agency MeetingSpecial Fire Protection District Meeting"

 

I ended up using the substitution activity to replace any new line characters with spaces, but the substitution activity would aggregate all the values in a multi-value token into a single value separated by "; ". I then used an Assign Token Value activity to split the values back into a multi-value token, and I used to the trim function to get rid of the extra space that the substitution activity added.

 

Is there a simpler way to deal with new lines? I've had multiple clients that have patterns across multiple lines, and I have not been able to deal with them effectively. The way I do it currently seems very roundabout.

 

 

You are not allowed to follow up in this post.

Sign in to reply to this post.