Add spanish as an example

Adding a new language without nlp requires now only to fill out the
pieces:

- define a list of month names to support date recognition
- add it to joex' dockerfile to be available for tesseract
- update the solr migration/field definitions
- update the elm file so it shows up on the client
This commit is contained in:
Eike Kettner
2021-01-17 12:18:23 +01:00
parent 360cad3304
commit 26dff18ae0
8 changed files with 49 additions and 2 deletions

View File

@ -65,6 +65,7 @@ object DateFind {
case Language.German => p1.or(p0).or(p2)
case Language.French => p1.or(p0).or(p2)
case Language.Italian => p1.or(p0).or(p2)
case Language.Spanish => p1.or(p0).or(p2)
}
p.read(parts) match {
case Result.Success(sds, _) =>

View File

@ -22,6 +22,8 @@ object MonthName {
french
case Language.Italian =>
italian
case Language.Spanish =>
spanish
}
private val numbers = List(
@ -98,4 +100,19 @@ object MonthName {
List("nov", "novembre"),
List("dic", "dicembre")
)
private val spanish = List(
List("ene", "enero"),
List("feb", "febrero"),
List("mar", "marzo"),
List("abr", "abril"),
List("may", "mayo"),
List("jun"),
List("jul"),
List("ago", "agosto"),
List("sep", "septiembre"),
List("oct", "octubre"),
List("nov", "noviembre"),
List("dic", "diciembre")
)
}