Skip to content

Commit

Permalink
Fix dbpedia#760: Duration parser in DIEF fails for words written in n…
Browse files Browse the repository at this point in the history
…on latin alphabets.
  • Loading branch information
Meti-Adane committed Jul 31, 2024
1 parent 208d2e9 commit 9ce9a09
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class DurationParser( context : { def language : Language } ) extends java.io.Se
val durationsMap = TimeValueUnitRegex.findAllIn(input).matchData.map{ m =>
{
// Seconds and minutes could be indicated as ','',"
val unit = timeUnits.get(m.subgroups(1).replaceAll("""[^\'\"a-zA-Z]""", "")).getOrElse(return None) // hack to deal with e.g "min)" matches
val unit = timeUnits.get(m.subgroups(1).replaceAll(s"""[^\'\"${timeUnitsRegex}]""", "")).getOrElse(return None) // hack to deal with e.g "min)" matches
val num = getNum(m).getOrElse(return None)
(unit, num) }
}.toMap
Expand Down

0 comments on commit 9ce9a09

Please sign in to comment.