HeidelTime / heideltime

A multilingual, cross-domain temporal tagger developed at the Database Systems Research Group at Heidelberg University.
GNU General Public License v3.0
343 stars 67 forks source link

strange rule matching error #21

Closed jzell closed 9 years ago

jzell commented 9 years ago
Can someone explain why this rule

RULENAME="date_r15k",EXTRACTION="il %reDayNumber %reMonthLong %reThisNextLast",NORM_VALUE="UNDEF-%normThisNextLast(group(3))-%normMonthToEnglish(group(2))-%normDay(group(1))"

works fine and matches

  il 3 aprile prossimo

but if I add this other rule

RULENAME="date_r15k",EXTRACTION="%reThisNextLast %reUnit",NORM_VALUE="UNDEF-%normThisNextLast(group(1))-%normUnit(group(2))"

I get this error:

 DEBUGGING: tonormalize:UNDEF-%normThisNextLast(group(1))-%normUnit(group(2))
 DEBUGGING: mr.group():%normThisNextLast(group(1))
 DEBUGGING: mr.group(1):normThisNextLast
 DEBUGGING: mr.group(2):1
 DEBUGGING: m.group():il 3 aprile prossimo
 DEBUGGING: m.group(1):3
 DEBUGGING: hmR...:null
 -----------------------------------
 Maybe problem with normalization of the resource: normThisNextLast
 Maybe problem with part to replace? 3

The second rule by itself works fine and matches "prossima settimana".

Thank you.

Original issue reported on code.google.com by attardi on 2014-10-19 22:15:37

jzell commented 9 years ago
For starters, you may want to name the second rule differently from the first one.

If that doesn't help, please let me know which version you're basing your test on.
And a small sample text file wouldn't hurt, or is "il 3 aprile prossimo settimana"
already enough?

Original issue reported on code.google.com by zell@informatik.uni-heidelberg.de on 2014-10-20 01:59:49

jzell commented 9 years ago
Thanks, that fixed it.

Original issue reported on code.google.com by attardi on 2014-10-20 07:04:38

jzell commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by zell@informatik.uni-heidelberg.de on 2014-10-20 16:15:22