Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Elasticsearch Services
Search Doc Service
Commits
2c76df90
Commit
2c76df90
authored
Sep 15, 2020
by
Jonas Waeber
Browse files
Fix alpha char missing crash. Will now place Z!
parent
bc25572e
Pipeline
#15892
failed with stages
in 10 minutes and 4 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/main/kotlin/helpers/FacetBuildHelpers.kt
View file @
2c76df90
...
@@ -19,13 +19,14 @@
...
@@ -19,13 +19,14 @@
package
org.memobase.helpers
package
org.memobase.helpers
import
com.beust.klaxon.JsonObject
import
com.beust.klaxon.JsonObject
import
org.apache.logging.log4j.LogManager
import
org.memobase.KEYS
import
org.memobase.KEYS
/**
/**
* Helper functions to build hierarchical facet values for places and persons.
* Helper functions to build hierarchical facet values for places and persons.
*/
*/
object
FacetBuildHelpers
{
object
FacetBuildHelpers
{
private
val
log
=
LogManager
.
getLogger
(
"FacetBuildHelper"
)
private
const
val
separator
=
"~"
private
const
val
separator
=
"~"
private
const
val
level1
=
"0"
private
const
val
level1
=
"0"
...
@@ -80,7 +81,12 @@ object FacetBuildHelpers {
...
@@ -80,7 +81,12 @@ object FacetBuildHelpers {
private
fun
getCapitalLetter
(
name
:
String
):
Char
{
private
fun
getCapitalLetter
(
name
:
String
):
Char
{
val
foldedName
=
AsciiFolder
.
foldToASCII
(
name
)
val
foldedName
=
AsciiFolder
.
foldToASCII
(
name
)
val
firstChar
=
foldedName
.
first
{
isAlphaChar
.
matches
(
it
.
toString
())
}
return
try
{
return
firstChar
.
toUpperCase
()
val
firstChar
=
foldedName
.
first
{
isAlphaChar
.
matches
(
it
.
toString
())
}
firstChar
.
toUpperCase
()
}
catch
(
ex
:
NoSuchElementException
)
{
log
.
error
(
"The name does not contain a valid alpha character: $foldedName."
)
'Z'
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment