Hi Peter,

I am trying to get information from a indented text file.

Input file text:
Underwriter's Name          Appraiser's Name/License          Appraisal
Company Name
Alice Wheaton               Bruce Banner                      Stark
Industries

Approach:
       I am trying to annotate fixed keywords like "Underwriter's Name" and
then go to line next to this annotated keyword.
       But I am not able to fetch UnderWriter's Name. It is giving all
instances which are matched(Alice Wheaton  Bruce, Wheaton Bruce Banner,
etc).


Code :

TYPESYSTEM utils.PlainTextTypeSystem;
ENGINE utils.PlainTextAnnotator;

EXEC(PlainTextAnnotator, {Line});
ADDRETAINTYPE(WS);
Line{->TRIM(WS)};
REMOVERETAINTYPE(WS);
Document{->FILTERTYPE(SPECIAL)};

DECLARE UnderWriterKeyword, NameKeyword, UnderWriterNameKeyword;
DECLARE UnderWriterName(String label, String value);

CW{REGEXP("\\bUnderwriter") -> UnderWriterKeyword};
CW{REGEXP("Name")->NameKeyword};
(UnderWriterKeyword SW NameKeyword){->UnderWriterNameKeyword};
Line{CONTAINS(UnderWriterNameKeyword)} Line -> {
   n:CW[1,3]{-> CREATE(UnderWriterName, "label"="UnderWriter Name",
"value"=n.ct)};
   };

Please tell me whether it is possible to achieve this using RUTA or not.
Also share steps to get Underwriter's Name, Appraiser's Name/License and
Appraisal Comapny Name.
I have already posted question similar to this on stackoverflow
https://stackoverflow.com/questions/58726610/using-ruta-get-a-data-present-in-next-line-of-annotated-keyword/58728364#58728364

Thanks,

Shashank Pathak

Reply via email to