Question
HCL Technologies
IN
Last activity: 26 Feb 2019 2:05 EST
Email Channel Interface - ruta scripts written for text extraction are not working
Hi Team,
We are implementing e-mail channel for our POC. We want to run text analyzer on our incoming e-mail to parse the email body. As part of that we are creating Decision Data entities and corresponding Text Files with ruta scripts. The challenge we are facing is that the body has content as below.
Hi Team,
Kindly raise a claim with below details.
Policy Number : XXXXXXX
Was there any fatality : Yes
Was there any witness : No etc..
Thanks & Regards,
ABC
So we want to set WasThereAnyFatality property to hold value "Yes", WasThereAnyWitness property to hold value "No" based on the information from email. We have written ruta script in text file with naming convention as EntityRule.FileName.ruta but the script does not seem to work. Your help will be greatly appreciated.
Was there any fatality script looks like below.
PACKAGE uima.ruta.example;
DECLARE VarA,VarB;
W?{REGEXP("(^Was there any fatality :)")-> MARK(VarA)}
SPACE?
W?{REGEXP("[Yes|No]")->MARKB, MARK(EntityType,1,3), UNMARK(VarA),UNMARK(VarB)};
The above script doesn't throw any error but when we test from Decision Data rule it doesn't extract anything when we provide input as "Was there any fatality : Yes".
Hi Team,
We are implementing e-mail channel for our POC. We want to run text analyzer on our incoming e-mail to parse the email body. As part of that we are creating Decision Data entities and corresponding Text Files with ruta scripts. The challenge we are facing is that the body has content as below.
Hi Team,
Kindly raise a claim with below details.
Policy Number : XXXXXXX
Was there any fatality : Yes
Was there any witness : No etc..
Thanks & Regards,
ABC
So we want to set WasThereAnyFatality property to hold value "Yes", WasThereAnyWitness property to hold value "No" based on the information from email. We have written ruta script in text file with naming convention as EntityRule.FileName.ruta but the script does not seem to work. Your help will be greatly appreciated.
Was there any fatality script looks like below.
PACKAGE uima.ruta.example;
DECLARE VarA,VarB;
W?{REGEXP("(^Was there any fatality :)")-> MARK(VarA)}
SPACE?
W?{REGEXP("[Yes|No]")->MARKB, MARK(EntityType,1,3), UNMARK(VarA),UNMARK(VarB)};
The above script doesn't throw any error but when we test from Decision Data rule it doesn't extract anything when we provide input as "Was there any fatality : Yes".
Our expectation is the property should hold the entire text and we can use WhatComesAfterFirst(:) function to get the exact value.
Kindly help us resolve the issue of parsing data from email body.
Thanks & Regards,
Soujanya
***Edited by Moderator: Pallavi to update platform capability tags***