Skip to content

Duration parser in DIEF fails for words written in non latin alphabets. #760

Open
@Meti-Adane

Description

@Meti-Adane

Describe the bug

  • The regex used in DurationParser.scala replaces all non latin alphabet characters with empty string hence duration indicator words for some languages are completely dropped and do not get parsed properly even if they are added in the config file.

Expected behaviour

  • should parse duration indicator words written in non latin alphabet as long as they are listed in the config file.

Environment

  • OS: macOS x 14.5
  • Java SDK Version 1.8:
  • Maven version 3.9.6 :

To reproduce

  • Bug can easily be re produced by adding tests in the test file.

  • Here is a simple example for the Greek language

"DurationParser" should "return 14400 seconds for 'context 4 ώρες'" in
{
parse("el", "Time", "context 4 ώρες").get should equal (14400.0)
}

  • run the test
  • the parser will return None even if the word (ώρες) corresponding to "hour" is listed in the config file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions