Search code examples
uimaignore-caseruta

UIMA Ruta wordlist case ignore


My use case is such that i have a list of match words in a WORDLIST "MonthNames.txt".

Now i want to Mark all the occurrences of these words in the given document irrespective of the text case.

PACKAGE uima.ruta.example;

WORDLIST MonthNameList = 'MonthNames.txt';
DECLARE MonthNames;
DECLARE MonthNameValue;


// Regex to be used in finding dates
STRING monthNameValueRegex = "(?i)(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|oct|nov|dec)";


// Mark month name


Document{-> MARKFAST(MonthNames, MonthNameList)};

Document{CONTAINS(MonthNames) -> MARK(MonthNameValue)};


 Document{REGEXP(monthNameValueRegex) -> MARK(MonthNameValue)};

Is there any way to do it ?

I tried

Document{-> MARKFAST(MonthNames, MonthNameList,true)};

But that is just to ignore whitespaces not text case.

Please help


Solution

  • Passing a 3rd variable as true makes it ignore the word case.

    Document{-> MARKFAST(MonthNames, MonthNameList,true)};

    Thanks to Peter for his help.