0

我有一个模式的保单编号:- AB-1234567- PAD产品代码是保单编号的最后3 个字符(PAD)

使用我的代码,我现在可以成功提取给定格式保单编号的产品代码 (PAD)。但是现在我需要根据可用的产品代码列表检查提取的产品代码(PAD)。目前,我正在使用,其中包含产品代码列表。但我不知道如何检查提取的产品代码是否在可用产品代码列表中匹配。STRINGLIST

下面是我的代码:

PACKAGE uima.ruta.example;

Document{->RETAINTYPE(SPACE)};


DECLARE Annotation ProdCode;

"(?i)\\b(?=.*\\d)[1]{0,1}[A-Z0-9]{2}[\\s |-]{0,2}[A-Z0-9]{7}[\\s |-]{0,2}([A-Z]{3})\\b"->1 = ProdCode; //<-Previously ProdCode was replaced with EntityType to get last 3 chars of given REGEX

STRINGLIST CustomSL = {"PLB","PAD"};

ProdCode{INLIST(CustomSL)->MARK(EntityType)}; //<- Requesting your help here!

例 1:

输入:The policy number is 1A-AB12345-PAD.

预期输出:PAD

例 2:

输入:The policy number is 1A-AB12345-PAN

预期输出:不应识别实体,因为给定的 STRINGLIST 中不存在 PAN

4

0 回答 0