mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 18:38:26 +00:00
Allow more suggestions for date variants in English
This commit is contained in:
@ -49,11 +49,11 @@ object DateFindSpec extends SimpleTestSuite {
|
||||
DateFind.findDates("on 11/05/2020", Language.English).toVector,
|
||||
Vector(
|
||||
NerDateLabel(
|
||||
LocalDate.of(2020, 11, 5),
|
||||
LocalDate.of(2020, 5, 11),
|
||||
NerLabel("11/05/2020", NerTag.Date, 3, 13)
|
||||
),
|
||||
NerDateLabel(
|
||||
LocalDate.of(2020, 5, 11),
|
||||
LocalDate.of(2020, 11, 5),
|
||||
NerLabel("11/05/2020", NerTag.Date, 3, 13)
|
||||
)
|
||||
)
|
||||
@ -69,4 +69,38 @@ object DateFindSpec extends SimpleTestSuite {
|
||||
)
|
||||
}
|
||||
|
||||
test("more english variants") {
|
||||
assertEquals(
|
||||
DateFind.findDates("on 26/01/15", Language.English).toVector,
|
||||
Vector(
|
||||
NerDateLabel(
|
||||
LocalDate.of(2015, 1, 26),
|
||||
NerLabel("26/01/15", NerTag.Date, 3, 11)
|
||||
),
|
||||
NerDateLabel(
|
||||
LocalDate.of(2026, 1, 15),
|
||||
NerLabel("26/01/15", NerTag.Date, 3, 11)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
DateFind.findDates("on 10/09/11", Language.English).toVector,
|
||||
Vector(
|
||||
NerDateLabel(
|
||||
LocalDate.of(2011, 9, 10),
|
||||
NerLabel("10/09/11", NerTag.Date, 3, 11)
|
||||
),
|
||||
NerDateLabel(
|
||||
LocalDate.of(2011, 10, 9),
|
||||
NerLabel("10/09/11", NerTag.Date, 3, 11)
|
||||
),
|
||||
NerDateLabel(
|
||||
LocalDate.of(2010, 9, 11),
|
||||
NerLabel("10/09/11", NerTag.Date, 3, 11)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user