mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 10:29:34 +00:00
Add hebrew document language
This commit is contained in:
parent
945ca6f561
commit
589c41003f
@ -30,6 +30,7 @@ RUN JDKPKG="openjdk11"; \
|
||||
tesseract-ocr-data-ron \
|
||||
tesseract-ocr-data-lav \
|
||||
tesseract-ocr-data-jpn \
|
||||
tesseract-ocr-data-heb \
|
||||
unpaper \
|
||||
wkhtmltopdf \
|
||||
libreoffice \
|
||||
|
@ -102,6 +102,7 @@ object DateFind {
|
||||
case Language.Dutch => dmy.or(ymd).or(mdy)
|
||||
case Language.Latvian => dmy.or(lavLong).or(ymd)
|
||||
case Language.Japanese => ymd
|
||||
case Language.Hebrew => dmy
|
||||
}
|
||||
p.read(parts) match {
|
||||
case Result.Success(sds, _) =>
|
||||
|
@ -52,6 +52,8 @@ object MonthName {
|
||||
latvian
|
||||
case Language.Japanese =>
|
||||
japanese
|
||||
case Language.Hebrew =>
|
||||
hebrew
|
||||
}
|
||||
|
||||
private val numbers = List(
|
||||
@ -307,4 +309,19 @@ object MonthName {
|
||||
List("11", "十一"),
|
||||
List("12", "十二")
|
||||
)
|
||||
|
||||
private val hebrew = List(
|
||||
List("1", "ינואר"),
|
||||
List("2", "פברואר"),
|
||||
List("3", "מרץ"),
|
||||
List("4", "אפריל"),
|
||||
List("5", "מאי"),
|
||||
List("6", "יוני"),
|
||||
List("7", "יולי"),
|
||||
List("8", "אוגוסט"),
|
||||
List("9", "ספטמבר"),
|
||||
List("10", "אוקטובר"),
|
||||
List("11", "נובמבר"),
|
||||
List("12", "דצמבר")
|
||||
)
|
||||
}
|
||||
|
@ -113,6 +113,12 @@ object Language {
|
||||
val iso3 = "jpn"
|
||||
}
|
||||
|
||||
case object Hebrew extends Language {
|
||||
val iso2 = "he"
|
||||
val iso3 = "heb"
|
||||
}
|
||||
|
||||
|
||||
val all: List[Language] =
|
||||
List(
|
||||
German,
|
||||
@ -130,7 +136,8 @@ object Language {
|
||||
Russian,
|
||||
Romanian,
|
||||
Latvian,
|
||||
Japanese
|
||||
Japanese,
|
||||
Hebrew
|
||||
)
|
||||
|
||||
def fromString(str: String): Either[String, Language] = {
|
||||
|
@ -114,7 +114,13 @@ object SolrSetup {
|
||||
"Add japanese content field",
|
||||
addContentField(Language.Japanese)
|
||||
),
|
||||
SolrMigration.reIndexAll(15, "Re-Index after adding japanese content field")
|
||||
SolrMigration.reIndexAll(15, "Re-Index after adding japanese content field"),
|
||||
SolrMigration[F](
|
||||
16,
|
||||
"Add hebrew content field",
|
||||
addContentField(Language.Hebrew)
|
||||
),
|
||||
SolrMigration.reIndexAll(17, "Re-Index after adding hebrew content field")
|
||||
)
|
||||
|
||||
def addFolderField: F[Unit] =
|
||||
|
@ -30,6 +30,7 @@ type Language
|
||||
| Dutch
|
||||
| Latvian
|
||||
| Japanese
|
||||
| Hebrew
|
||||
|
||||
|
||||
fromString : String -> Maybe Language
|
||||
@ -82,6 +83,9 @@ fromString str =
|
||||
else if str == "jpn" || str == "ja" || str == "japanese" then
|
||||
Just Japanese
|
||||
|
||||
else if str == "heb" || str == "he" || str == "hebrew" then
|
||||
Just Hebrew
|
||||
|
||||
else
|
||||
Nothing
|
||||
|
||||
@ -137,6 +141,9 @@ toIso3 lang =
|
||||
Japanese ->
|
||||
"jpn"
|
||||
|
||||
Hebrew ->
|
||||
"heb"
|
||||
|
||||
|
||||
all : List Language
|
||||
all =
|
||||
@ -156,4 +163,5 @@ all =
|
||||
, Romanian
|
||||
, Latvian
|
||||
, Japanese
|
||||
, Hebrew
|
||||
]
|
||||
|
@ -64,6 +64,9 @@ gb lang =
|
||||
Japanese ->
|
||||
"Japanese"
|
||||
|
||||
Hebrew ->
|
||||
"Hebrew"
|
||||
|
||||
|
||||
de : Language -> String
|
||||
de lang =
|
||||
@ -115,3 +118,6 @@ de lang =
|
||||
|
||||
Japanese ->
|
||||
"Japanisch"
|
||||
|
||||
Hebrew ->
|
||||
"Hebräisch"
|
||||
|
Loading…
x
Reference in New Issue
Block a user