Skip to content

Commit

Permalink
fix expression search type matching
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Mar 10, 2024
1 parent bd726b0 commit 31518c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/kotlin/org/reactome/lit_ball/common/ArticleType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ enum class ArticleType(val s2name: String) {
REVIEW("Review");
}

fun typeStringsToBoolArray(types: List<String>): BooleanArray {
return BooleanArray(ArticleType.entries.size) { index ->
ArticleType.entries[index].s2name in types
}
}

fun typeMatches(publicationTypes: List<String>?, filteredTypes: BooleanArray?): Boolean {
publicationTypes?.let { pTypes ->
filteredTypes?.let { fTypes ->
Expand All @@ -20,4 +26,5 @@ fun typeMatches(publicationTypes: List<String>?, filteredTypes: BooleanArray?):
return false
}
return true
}
}

1 change: 1 addition & 0 deletions src/main/kotlin/org/reactome/lit_ball/common/QueryList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ object QueryList {
}
}
newQuery.type = newQuery.setting.type
newQuery.expSearchParams = Pair(newQuery.setting.pubDate, typeStringsToBoolArray(newQuery.setting.pubType))
newQuery
}
}
Expand Down

0 comments on commit 31518c4

Please sign in to comment.