Skip to content

Commit

Permalink
Fjern NO HIT (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
noraness authored Dec 4, 2023
1 parent abc5f71 commit cc130ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
29 changes: 3 additions & 26 deletions src/main/kotlin/no/nav/cv/eures/janzz/JanzzService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,11 @@ class JanzzService(

if (json == null) {
log.error("Janzz query for term $term returned null")
return listOf(
CachedEscoMapping(
term = term,
conceptId = "",
esco = "NO HIT",
updated = ZonedDateTime.now())
)
return listOf()
}

//exact match
val res = objectMapper.readValue<List<JanzzEscoLabelMapping>>(json).firstOrNull() ?: return listOf(
CachedEscoMapping(
term = term,
conceptId = "",
esco = "NO HIT",
updated = ZonedDateTime.now()
)
)
val res = objectMapper.readValue<List<JanzzEscoLabelMapping>>(json).firstOrNull() ?: return listOf()

val escoSubstring = when(escoLookupType) {
EscoLookupType.SKILL -> skillEscoSubstring
Expand All @@ -112,16 +99,6 @@ class JanzzService(
updated = ZonedDateTime.now()
)
}

return hits.ifEmpty {
log.info("Janzz query for term $term had no valid isco codes")
listOf(
CachedEscoMapping(
term = term,
conceptId = "",
esco = "NO HIT",
updated = ZonedDateTime.now())
)
}
return hits
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ internal class JanzzServiceTest {
println(janzzService.getEscoForTerm("Programmering", JanzzService.EscoLookupType.SKILL))
println(janzzService.getEscoForTerm("Programmering", JanzzService.EscoLookupType.SKILL))

println(janzzService.getEscoForTerm("NO HIT", JanzzService.EscoLookupType.SKILL))
println(janzzService.getEscoForTerm("NO HIT", JanzzService.EscoLookupType.SKILL))

println(janzzService.getEscoForTerm("Førstestyrmann", JanzzService.EscoLookupType.OCCUPATION))
println(janzzService.getEscoForTerm("Førstestyrmann", JanzzService.EscoLookupType.OCCUPATION))
}
Expand Down

0 comments on commit cc130ba

Please sign in to comment.